#LyX 1.6.7 created this file. For more info see http://www.lyx.org/
\lyxformat 345
\begin_document
\begin_header
\textclass article
\begin_preamble
\usepackage{xcolor}
\end_preamble
\use_default_options true
\language english
\inputencoding auto
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry true
\use_amsmath 1
\use_esint 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\leftmargin 2cm
\topmargin 2cm
\rightmargin 2cm
\bottommargin 3cm
\headheight 2cm
\headsep 2cm
\footskip 2cm
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip smallskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\author "" 
\author "" 
\end_header

\begin_body

\begin_layout Title
Principal Component Analysis
\begin_inset Newline newline
\end_inset

Task #2
\end_layout

\begin_layout Author
Student: Sergi Blanco Cuaresma
\end_layout

\begin_layout Abstract
Solutions to the classification tasks (OCR) from the subject Statistics,
 Monte Carlo Methods and Data Processing - Master in Astrophysics, Particle
 Physics and Cosmology (Universitat de Barcelona).
\end_layout

\begin_layout Abstract
\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset


\end_layout

\begin_layout Abstract
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Section
Introduction
\end_layout

\begin_layout Subsection
Description
\end_layout

\begin_layout Standard
In order to provide a solution for the different tasks and facilitate future
 results validations, several automatic processes has been implemented using
 the R language and Ruby.
 This document presents the results for each task and its respective analysis.
\end_layout

\begin_layout Standard
Weka
\begin_inset Foot
status open

\begin_layout Plain Layout
http://www.cs.waikato.ac.nz/ml/weka/
\end_layout

\end_inset

 has been used for attribute analysis and classification algorithms testing,
 while neural networks has been designed with JavaNNS
\begin_inset Foot
status open

\begin_layout Plain Layout
http://www.ra.cs.uni-tuebingen.de/software/JavaNNS/
\end_layout

\end_inset

.
\end_layout

\begin_layout Standard
Apart from this report, the following directories has been included:
\end_layout

\begin_layout Enumerate
\begin_inset Quotes eld
\end_inset

Original ARFF Statistical Analysis
\begin_inset Quotes erd
\end_inset

: Original input data and statistical results produced by the R script.
\end_layout

\begin_layout Enumerate
\begin_inset Quotes eld
\end_inset

Weka Experimenter
\begin_inset Quotes erd
\end_inset

: Original input data + two reduced versions (PCA 95% and 75%) and experimenter
 results.
\end_layout

\begin_layout Enumerate
\begin_inset Quotes eld
\end_inset

Convert + rescale ARFF to PAT Train + Test
\begin_inset Quotes erd
\end_inset

: Original input data + two reduced versions (PCA 95% and 75%) and the 12
 output files produced by the Ruby script:
\end_layout

\begin_deeper
\begin_layout Enumerate
Train (70%) and test subdatasets (30%) for each input file (original, PCA95
 and PCA70), using:
\end_layout

\begin_deeper
\begin_layout Enumerate
Binary representation of letters
\end_layout

\begin_layout Enumerate
Numeric representation of letters
\end_layout

\end_deeper
\end_deeper
\begin_layout Enumerate
\begin_inset Quotes eld
\end_inset

JavaNNS results
\begin_inset Quotes erd
\end_inset

:
\end_layout

\begin_deeper
\begin_layout Enumerate
Input: Data converted in point 3 and initial neural networks.
\end_layout

\begin_layout Enumerate
Output: Trained networks and data results.
\end_layout

\end_deeper
\begin_layout Enumerate
\begin_inset Quotes eld
\end_inset

JavaNNS comparison
\begin_inset Quotes erd
\end_inset

: Analysis of JavaNNS data results done by the Ruby script.
\end_layout

\begin_layout Section
\begin_inset CommandInset label
LatexCommand label
name "sec:Letter-Image-Recognition"

\end_inset

Letter Image Recognition Data (OCR)
\end_layout

\begin_layout Subsection
Description of the sample
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Box Boxed
position "t"
hor_pos "c"
has_inner_box 1
inner_pos "t"
use_parbox 0
width "80col%"
special "none"
height "1in"
height_special "totalheight"
status open

\begin_layout Plain Layout

\emph on
Disclaimer:
\emph default
 Most of the information presented in this section has been obtained directly
 from the paper 
\begin_inset Quotes eld
\end_inset

Letter Recognition Using Holland-Style Adaptive Classifiers
\begin_inset Quotes eld
\end_inset

 (see reference section).
\end_layout

\end_inset


\end_layout

\begin_layout Subsubsection
Context
\end_layout

\begin_layout Standard
The sample used in this study has been obtained from the paper 
\begin_inset Quotes eld
\end_inset

Letter Recognition Using Holland-Style Adaptive Classifiers
\begin_inset Quotes eld
\end_inset

, where the authors generated a set of 20,000 unique letter images by randomly
 distorting pixel images of the 26 uppercase letters from 20 different commercia
l fonts.
 Concretely, this study will use a subset of 9.940 letters from the original
 one.
\end_layout

\begin_layout Subsubsection
Acquisition process
\end_layout

\begin_layout Standard
For the letters generation, the 20 different used fonts (Roman alphabet)
 represent five different stroke styles (simplex, duplex, triplex, complex,
 and Gothic) and six different letter styles (block, script, italic, English,
 Italian, and German).
 Each character were generated with random uniformly distributed parameter
 values for font type, letter of the alphabet, linear magnification (from
 1.0 to 1.6), aspect ratio (or horizontal magnification from 1.0 to 1.5), and
 horizontal and vertical 
\begin_inset Quotes eld
\end_inset

warp
\begin_inset Quotes erd
\end_inset

 (stretching/shrinking a region).
 The resulting image for each character consisted in a picture of 45 pixels
 high by 45 pixels wide, which was fairly recognizable by humans.
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename Generated letters.png
	lyxscale 50
	scale 20

\end_inset


\end_layout

\begin_layout Subsubsection
Objects
\end_layout

\begin_layout Standard
The features of each of the 9.940 characters (composed by 26 uppercase letters)
 are summarized in terms of a class and 16 primitive numerical attributes:
\end_layout

\begin_layout Enumerate
Uppercase letter that represents.
\end_layout

\begin_layout Enumerate
The horizontal position, counting pixels from the left edge of the image,
 of the center of the smallest rectangular box that can be drawn with all
 "on" pixels inside the box.
\end_layout

\begin_layout Enumerate
The vertical position, counting pixels from the bottom, of the above box.
\end_layout

\begin_layout Enumerate
The width, in pixels, of the box.
\end_layout

\begin_layout Enumerate
The height, in pixels, of the box.
\end_layout

\begin_layout Enumerate
The total number of "on" pixels in the character image.
\end_layout

\begin_layout Enumerate
The mean horizontal position of all "on" pixels relative to the center of
 the box and divided by the width of the box.
 This feature has a negative value if the image is "left-heavy" as would
 be the case for the letter L.
\end_layout

\begin_layout Enumerate
The mean vertical position of all "on" pixels relative to the center of
 the box and divided by the height of the box.
\end_layout

\begin_layout Enumerate
The mean squared value of the horizontal pixel distances as measured in
 6 above.
 This attribute will have a higher value for images whose pixels are more
 widely separated in the horizontal direction as would be the case for the
 letters W or M.
\end_layout

\begin_layout Enumerate
The mean squared value of the vertical pixel distances as measured in 7
 above.
\end_layout

\begin_layout Enumerate
The mean product of the horizontal and vertical distances for each "on"
 pixel as measured in 6 and 7 above.
 This attribute has a positive value for diagonal lines that run from bottom
 left to top right and a negative value for diagonal lines from top left
 to bottom right.
\end_layout

\begin_layout Enumerate
The mean value of the squared horizontal distance tunes the vertical distance
 for each "on" pixel.
 This measures the correlation of the horizontal variance with the vertical
 position.
\end_layout

\begin_layout Enumerate
The mean value of the squared vertical distance times the horizontal distance
 for each "on" pixel.
 This measures the correlation of the vertical variance with the horizontal
 position.
\end_layout

\begin_layout Enumerate
The mean number of edges (an "on" pixel immediately to the right of either
 an "off pixel or the image boundary) encountered when making systematic
 scans from left to right at all vertical positions within the box.
 This measure distinguishes between letters like "W" or "M" and letters
 like "I" or "L."
\end_layout

\begin_layout Enumerate
The sum of the vertical positions of edges encountered as measured in 13
 above.
 This feature will give a higher value if there are more edges at the top
 of the box, as in the letter "Y."
\end_layout

\begin_layout Enumerate
The mean number of edges (an "on" pixel immediately above either an "off
 pixel or the image boundary) encountered when making systematic scans of
 the image from bottom to top over all horizontal positions within the box.
\end_layout

\begin_layout Enumerate
The sum of horizontal positions of edges encountered as measured in 15 above.
\end_layout

\begin_layout Subsubsection
General characteristics
\end_layout

\begin_layout Standard
The subset sample is composed by 9.940 characters which represent 26 uppercase
 letters.
 They are in a ARFF file format (Weka) with attributes stored in the same
 order they have been presented in the above section.
\end_layout

\begin_layout Subsection
Statistical analysis
\end_layout

\begin_layout Standard
R is the perfect environment for data treatment and general statistics generatio
n.
 A small R script has been created for this purpose (code in section 
\begin_inset CommandInset ref
LatexCommand vref
reference "sec:Annex-I.-StatisticalAnalysis"

\end_inset

) and the results are presented in this section.
\end_layout

\begin_layout Subsubsection
Key indicators
\end_layout

\begin_layout Standard
A brief statistical analysis has been perform on the attributes of the 9.940
 characters:
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="17" columns="7">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Attribute
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Mean
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Variance
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Std Deviation
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Min
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Max
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Median
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
yegvx
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
7.78
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.56
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
1.60
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
1
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
y2bar
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
5.18
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
5.70
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.39
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
y.var.pix
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
7.52
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
5.46
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.34
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
y.ege
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
3.69
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
6.62
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.57
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
14
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
y.box
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
6.99
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
11.02
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
3.32
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
xybar
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
8.30
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
6.22
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.49
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
xy2br
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
7.93
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
4.32
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.08
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
xegvy
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
8.34
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.39
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
1.55
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
x2ybr
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
6.49
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
6.91
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.63
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
x2bar
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
4.63
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
7.45
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.73
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
x.var.pix
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
6.88
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
4.10
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.02
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
x.ege
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
3.03
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
5.45
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.33
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
x.box
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
4.01
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
3.64
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
1.91
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
width.box
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
5.11
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
4.05
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.01
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
npix
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
3.50
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
4.85
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.20
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
height.box
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
5.35
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
5.14
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
2.27
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
0
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
Histograms
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="1" columns="2">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.1.yegvx.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.2.y2bar.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="1" columns="2">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.3.y.var.pix.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.4.y.ege.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="1" columns="2">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.5.y.box.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.6.xybar.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="1" columns="2">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.7.xy2br.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.8.xegvy.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="1" columns="2">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.9.x2ybr.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.10.x2bar.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="1" columns="2">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.11.x.var.pix.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.12.x.ege.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="1" columns="2">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.13.x.box.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.14.width.box.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="1" columns="2">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.15.npix.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Graphics
	filename output/Histogram.16.heigth.box.png
	lyxscale 50
	scale 25

\end_inset


\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsection
\begin_inset CommandInset label
LatexCommand label
name "sub:Pretreatment"

\end_inset

Pretreatment
\end_layout

\begin_layout Subsubsection
\begin_inset CommandInset label
LatexCommand label
name "sub:Principal-Components-Analysis95:"

\end_inset

Principal Components Analysis: 95% of variance coverage
\end_layout

\begin_layout Standard
Using Weka it is possible to perform a Principal Components Analysis that
 will allow us to reduce the dimensionality of the problem by identification
 of linear correlation between attributes.
 With 95% of variance coverage, it is possible to make a reduction from
 16 attributes to 12:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},numbers=left,numberstyle={\tiny}"
inline false
status open

\begin_layout Plain Layout

=== Run information ===
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Evaluator:    weka.attributeSelection.PrincipalComponents -R 0.95 -A 5
\end_layout

\begin_layout Plain Layout

Search:       weka.attributeSelection.Ranker -T -1.7976931348623157E308 -N
 -1
\end_layout

\begin_layout Plain Layout

Relation:     letter-recognition
\end_layout

\begin_layout Plain Layout

Instances:    9940
\end_layout

\begin_layout Plain Layout

Attributes:   17
\end_layout

\begin_layout Plain Layout

              class
\end_layout

\begin_layout Plain Layout

              x-box
\end_layout

\begin_layout Plain Layout

              y-box
\end_layout

\begin_layout Plain Layout

              width-box
\end_layout

\begin_layout Plain Layout

              heigth-box
\end_layout

\begin_layout Plain Layout

              npix
\end_layout

\begin_layout Plain Layout

              x-var-pix
\end_layout

\begin_layout Plain Layout

              y-var-pix
\end_layout

\begin_layout Plain Layout

              x2bar
\end_layout

\begin_layout Plain Layout

              y2bar
\end_layout

\begin_layout Plain Layout

              xybar
\end_layout

\begin_layout Plain Layout

              x2ybr
\end_layout

\begin_layout Plain Layout

              xy2br
\end_layout

\begin_layout Plain Layout

              x-ege
\end_layout

\begin_layout Plain Layout

              xegvy
\end_layout

\begin_layout Plain Layout

              y-ege
\end_layout

\begin_layout Plain Layout

              yegvx
\end_layout

\begin_layout Plain Layout

Evaluation mode:    evaluate on all training data
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

=== Attribute Selection on all input data ===
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Search Method:
\end_layout

\begin_layout Plain Layout

	Attribute ranking.
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Attribute Evaluator (unsupervised):
\end_layout

\begin_layout Plain Layout

	Principal Components Attribute Transformer
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Correlation matrix
\end_layout

\begin_layout Plain Layout

  1      0.76   0.85   0.68   0.62  -0.03   0.04   0.02   0.06   0.15   0.03  -0.05
   0.48   0.08   0.28  -0.1  
\end_layout

\begin_layout Plain Layout

  0.76   1      0.67   0.82   0.56   0.04  -0.04  -0.02   0.09   0.16  -0.05  -0.01
   0.27  -0.01   0.24  -0.05 
\end_layout

\begin_layout Plain Layout

  0.85   0.67   1      0.66   0.77   0.07   0.02  -0.1    0.06   0.12   0.01  -0.05
   0.55   0.03   0.27  -0.11 
\end_layout

\begin_layout Plain Layout

  0.68   0.82   0.66   1      0.65   0.03  -0.01   0.08   0.06   0.01  -0.01   0.02
   0.27   0.02   0.3   -0.02 
\end_layout

\begin_layout Plain Layout

  0.62   0.56   0.77   0.65   1      0.14  -0.03  -0.01  -0.06  -0.07  -0.08  -0.04
   0.63   0      0.5   -0.06 
\end_layout

\begin_layout Plain Layout

 -0.03   0.04   0.07   0.03   0.14   1     -0.35  -0.05  -0.13   0.08  -0.33  -0.03
   0.16  -0.25   0.13   0.25 
\end_layout

\begin_layout Plain Layout

  0.04  -0.04   0.02  -0.01  -0.03  -0.35   1     -0.13  -0.04   0.19   0.6   -0.28
  -0.05   0.55  -0.08  -0.21 
\end_layout

\begin_layout Plain Layout

  0.02  -0.02  -0.1    0.08  -0.01  -0.05  -0.13   1     -0.2   -0.32   0.04   0.08
   0.15  -0.09   0      0.19 
\end_layout

\begin_layout Plain Layout

  0.06   0.09   0.06   0.06  -0.06  -0.13  -0.04  -0.2    1      0.14  -0.06   0.12
  -0.38  -0.04   0.28  -0.06 
\end_layout

\begin_layout Plain Layout

  0.15   0.16   0.12   0.01  -0.07   0.08   0.19  -0.32   0.14   1      0.06  -0.1
   -0.18   0.03  -0.09  -0.12 
\end_layout

\begin_layout Plain Layout

  0.03  -0.05   0.01  -0.01  -0.08  -0.33   0.6    0.04  -0.06   0.06   1      0.06
   0.04   0.52  -0.23  -0.24 
\end_layout

\begin_layout Plain Layout

 -0.05  -0.01  -0.05   0.02  -0.04  -0.03  -0.28   0.08   0.12  -0.1    0.06   1  
   -0.01  -0.19   0.05   0.25 
\end_layout

\begin_layout Plain Layout

  0.48   0.27   0.55   0.27   0.63   0.16  -0.05   0.15  -0.38  -0.18   0.04  -0.01
   1     -0.02   0.12  -0.04 
\end_layout

\begin_layout Plain Layout

  0.08  -0.01   0.03   0.02   0     -0.25   0.55  -0.09  -0.04   0.03   0.52  -0.19
  -0.02   1     -0.06  -0.19 
\end_layout

\begin_layout Plain Layout

  0.28   0.24   0.27   0.3    0.5    0.13  -0.08   0      0.28  -0.09  -0.23   0.05
   0.12  -0.06   1      0.14 
\end_layout

\begin_layout Plain Layout

 -0.1   -0.05  -0.11  -0.02  -0.06   0.25  -0.21   0.19  -0.06  -0.12  -0.24   0.25
  -0.04  -0.19   0.14   1    
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

eigenvalue	proportion	cumulative
\end_layout

\begin_layout Plain Layout

  4.31144	  0.26946	  0.26946	-0.436width-box-0.426x-box-0.417npix-0.4heigth-box-0.399y-
box...
\end_layout

\begin_layout Plain Layout

  2.62272	  0.16392	  0.43338	-0.509y-var-pix-0.467x2ybr-0.453xegvy+0.324x-var-pix+0.314
yegvx...
\end_layout

\begin_layout Plain Layout

  1.7285 	  0.10803	  0.54142	-0.556y2bar+0.452x2bar-0.433xybar+0.43 x-ege+0.184x2ybr...
\end_layout

\begin_layout Plain Layout

  1.35958	  0.08497	  0.62639	-0.497xy2br+0.421x-var-pix-0.383y2bar+0.322xybar-0.313x2ba
r...
\end_layout

\begin_layout Plain Layout

  1.05434	  0.0659 	  0.69229	0.613y-ege-0.445xy2br-0.371xybar-0.239y-box+0.232npix...
\end_layout

\begin_layout Plain Layout

  0.97429	  0.06089	  0.75318	-0.636yegvx-0.435x-var-pix-0.281xegvy-0.278xybar-0.257y-va
r-pix...
\end_layout

\begin_layout Plain Layout

  0.89406	  0.05588	  0.80906	-0.518xy2br+0.494x2bar-0.36x-ege+0.296yegvx+0.273y-box...
\end_layout

\begin_layout Plain Layout

  0.62559	  0.0391 	  0.84816	0.547x2bar+0.503xybar-0.304xegvy+0.293y-ege-0.239heigth-bo
x...
\end_layout

\begin_layout Plain Layout

  0.59126	  0.03695	  0.88511	-0.648x-var-pix+0.42 yegvx-0.294xegvy-0.253x2ybr+0.221y-va
r-pix...
\end_layout

\begin_layout Plain Layout

  0.49325	  0.03083	  0.91594	-0.536y2bar+0.357y-ege+0.314heigth-box-0.303width-box-0.29
1yegvx...
\end_layout

\begin_layout Plain Layout

  0.4304 	  0.0269 	  0.94284	0.633xegvy-0.414y-var-pix-0.338x2ybr+0.291xybar-0.205y2bar...
\end_layout

\begin_layout Plain Layout

  0.26207	  0.01638	  0.95922	0.566npix-0.512x-box-0.332y-ege+0.27 heigth-box-0.236y-box...
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Eigenvectors
\end_layout

\begin_layout Plain Layout

 V1	 V2	 V3	 V4	 V5	 V6	 V7	 V8	 V9	 V10	 V11	 V12	
\end_layout

\begin_layout Plain Layout

-0.426 	-0.0881	-0.0373	-0.0235	-0.1447	 0.042 	 0.0723	 0.0563	 0.1042	-0.2668	 0.1816	-0.5
116	x-box
\end_layout

\begin_layout Plain Layout

-0.3987	-0.0243	-0.1375	-0.0605	-0.2388	 0.0507	 0.2728	-0.2255	-0.0924	 0.1449	-0.039
 	-0.236 	y-box
\end_layout

\begin_layout Plain Layout

-0.4361	-0.0588	-0.0328	 0.064 	-0.073 	 0.0142	-0.1302	 0.0138	 0.0943	-0.3033	-0.0409	
 0.0826	width-box
\end_layout

\begin_layout Plain Layout

-0.4001	-0.0171	-0.0455	-0.155 	-0.1254	 0.0333	 0.2726	-0.2388	-0.1872	 0.3144	-0.1778	
 0.2701	heigth-box
\end_layout

\begin_layout Plain Layout

-0.4171	 0.032 	 0.0999	 0.0349	 0.232 	-0.0433	-0.1958	 0.0428	 0.0405	 0.1449	-0.0535	
 0.5661	npix
\end_layout

\begin_layout Plain Layout

-0.0572	 0.3236	-0.0163	 0.4211	 0.0502	-0.435 	 0.0046	 0.0614	-0.6479	-0.0668	-0.1938	-0.1
222	x-var-pix
\end_layout

\begin_layout Plain Layout

 0.0197	-0.5094	 0.0349	-0.0177	 0.1565	-0.2573	 0.105 	 0.113 	 0.2206	 0.1424	-0.4137	-0.0
305	y-var-pix
\end_layout

\begin_layout Plain Layout

-0.0021	 0.123 	 0.4517	-0.3125	-0.0738	 0.1359	 0.4942	 0.5473	-0.2038	-0.0761	 0.1235	
 0.1316	x2bar
\end_layout

\begin_layout Plain Layout

-0.0101	 0.003 	-0.5557	-0.3833	 0.1559	 0.1109	-0.0651	 0.1656	-0.2011	-0.5362	-0.2051	
 0.1897	y2bar
\end_layout

\begin_layout Plain Layout

-0.0263	-0.1553	-0.4327	 0.3216	-0.3713	-0.278 	 0.1125	 0.5031	 0.1638	 0.1328	 0.2906	
 0.2188	xybar
\end_layout

\begin_layout Plain Layout

 0.0305	-0.4672	 0.1843	-0.206 	-0.1763	-0.2248	-0.1646	 0.1699	-0.2528	-0.0126	-0.3382	-0.1
604	x2ybr
\end_layout

\begin_layout Plain Layout

 0.0178	 0.1897	 0.0103	-0.4966	-0.4445	-0.2315	-0.5175	 0.0003	-0.0847	 0.2275	 0.1625	
 0.0067	xy2br
\end_layout

\begin_layout Plain Layout

-0.2883	 0.0305	 0.4295	 0.1984	 0.0181	-0.0114	-0.3597	 0.1944	 0.1414	-0.2485	 0.0026	-0.0
037	x-ege
\end_layout

\begin_layout Plain Layout

-0.0006	-0.4535	 0.0968	-0.0795	 0.2156	-0.2811	 0.0588	-0.3043	-0.2937	-0.1846	 0.6331	
 0.1501	xegvy
\end_layout

\begin_layout Plain Layout

-0.2131	 0.1542	-0.1672	-0.2532	 0.6126	-0.2017	-0.0576	 0.2926	 0.0627	 0.3573	 0.1619	-0.3
325	y-ege
\end_layout

\begin_layout Plain Layout

 0.0339	 0.3142	 0.096 	-0.2048	-0.0423	-0.6364	 0.2958	-0.213 	 0.42  	-0.2914	-0.105
 	 0.0798	yegvx
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Ranked attributes:
\end_layout

\begin_layout Plain Layout

 0.7305   1 -0.436width-box-0.426x-box-0.417npix-0.4heigth-box-0.399y-box...
\end_layout

\begin_layout Plain Layout

 0.5666   2 -0.509y-var-pix-0.467x2ybr-0.453xegvy+0.324x-var-pix+0.314yegvx...
\end_layout

\begin_layout Plain Layout

 0.4586   3 -0.556y2bar+0.452x2bar-0.433xybar+0.43 x-ege+0.184x2ybr...
\end_layout

\begin_layout Plain Layout

 0.3736   4 -0.497xy2br+0.421x-var-pix-0.383y2bar+0.322xybar-0.313x2bar...
\end_layout

\begin_layout Plain Layout

 0.3077   5 0.613y-ege-0.445xy2br-0.371xybar-0.239y-box+0.232npix...
\end_layout

\begin_layout Plain Layout

 0.2468   6 -0.636yegvx-0.435x-var-pix-0.281xegvy-0.278xybar-0.257y-var-pix...
\end_layout

\begin_layout Plain Layout

 0.1909   7 -0.518xy2br+0.494x2bar-0.36x-ege+0.296yegvx+0.273y-box...
\end_layout

\begin_layout Plain Layout

 0.1518   8 0.547x2bar+0.503xybar-0.304xegvy+0.293y-ege-0.239heigth-box...
\end_layout

\begin_layout Plain Layout

 0.1149   9 -0.648x-var-pix+0.42 yegvx-0.294xegvy-0.253x2ybr+0.221y-var-pix...
\end_layout

\begin_layout Plain Layout

 0.0841  10 -0.536y2bar+0.357y-ege+0.314heigth-box-0.303width-box-0.291yegvx...
\end_layout

\begin_layout Plain Layout

 0.0572  11 0.633xegvy-0.414y-var-pix-0.338x2ybr+0.291xybar-0.205y2bar...
\end_layout

\begin_layout Plain Layout

 0.0408  12 0.566npix-0.512x-box-0.332y-ege+0.27 heigth-box-0.236y-box...
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Selected attributes: 1,2,3,4,5,6,7,8,9,10,11,12 : 12
\end_layout

\end_inset


\end_layout

\begin_layout Standard
A file has been generated named 
\begin_inset Quotes eld
\end_inset

OCR.PCA95.arff
\begin_inset Quotes erd
\end_inset

 with the transformed data.
 Consequently, data is represented by 12 different variable, which correspond
 to a combination of the 16 original attributes that has been presented
 in previous sections.
\end_layout

\begin_layout Subsubsection
\begin_inset CommandInset label
LatexCommand label
name "sub:Principal-Components-Analysis:70"

\end_inset

Principal Components Analysis: 70% of variance coverage
\end_layout

\begin_layout Standard
As exposed in the previous section, Weka can perform a Principal Components
 Analysis that will allow us to reduce the dimensionality of the problem
 by identification of linear correlation between attributes.
 In this case a variance coverage of 70% has been applied, reducing the
 number of attributes from 16 to 6:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},numbers=left,numberstyle={\tiny}"
inline false
status open

\begin_layout Plain Layout

=== Run information ===
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Evaluator:    weka.attributeSelection.PrincipalComponents -R 0.7 -A 5
\end_layout

\begin_layout Plain Layout

Search:       weka.attributeSelection.Ranker -T -1.7976931348623157E308 -N
 -1
\end_layout

\begin_layout Plain Layout

Relation:     letter-recognition-weka.filters.unsupervised.attribute.Reorder-R2,3,4,
5,6,7,8,9,10,11,12,13,14,15,16,17,1
\end_layout

\begin_layout Plain Layout

Instances:    9940
\end_layout

\begin_layout Plain Layout

Attributes:   17
\end_layout

\begin_layout Plain Layout

              x-box
\end_layout

\begin_layout Plain Layout

              y-box
\end_layout

\begin_layout Plain Layout

              width-box
\end_layout

\begin_layout Plain Layout

              heigth-box
\end_layout

\begin_layout Plain Layout

              npix
\end_layout

\begin_layout Plain Layout

              x-var-pix
\end_layout

\begin_layout Plain Layout

              y-var-pix
\end_layout

\begin_layout Plain Layout

              x2bar
\end_layout

\begin_layout Plain Layout

              y2bar
\end_layout

\begin_layout Plain Layout

              xybar
\end_layout

\begin_layout Plain Layout

              x2ybr
\end_layout

\begin_layout Plain Layout

              xy2br
\end_layout

\begin_layout Plain Layout

              x-ege
\end_layout

\begin_layout Plain Layout

              xegvy
\end_layout

\begin_layout Plain Layout

              y-ege
\end_layout

\begin_layout Plain Layout

              yegvx
\end_layout

\begin_layout Plain Layout

              class
\end_layout

\begin_layout Plain Layout

Evaluation mode:    evaluate on all training data
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

=== Attribute Selection on all input data ===
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Search Method:
\end_layout

\begin_layout Plain Layout

	Attribute ranking.
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Attribute Evaluator (unsupervised):
\end_layout

\begin_layout Plain Layout

	Principal Components Attribute Transformer
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Correlation matrix
\end_layout

\begin_layout Plain Layout

  1      0.76   0.85   0.68   0.62  -0.03   0.04   0.02   0.06   0.15   0.03  -0.05
   0.48   0.08   0.28  -0.1  
\end_layout

\begin_layout Plain Layout

  0.76   1      0.67   0.82   0.56   0.04  -0.04  -0.02   0.09   0.16  -0.05  -0.01
   0.27  -0.01   0.24  -0.05 
\end_layout

\begin_layout Plain Layout

  0.85   0.67   1      0.66   0.77   0.07   0.02  -0.1    0.06   0.12   0.01  -0.05
   0.55   0.03   0.27  -0.11 
\end_layout

\begin_layout Plain Layout

  0.68   0.82   0.66   1      0.65   0.03  -0.01   0.08   0.06   0.01  -0.01   0.02
   0.27   0.02   0.3   -0.02 
\end_layout

\begin_layout Plain Layout

  0.62   0.56   0.77   0.65   1      0.14  -0.03  -0.01  -0.06  -0.07  -0.08  -0.04
   0.63   0      0.5   -0.06 
\end_layout

\begin_layout Plain Layout

 -0.03   0.04   0.07   0.03   0.14   1     -0.35  -0.05  -0.13   0.08  -0.33  -0.03
   0.16  -0.25   0.13   0.25 
\end_layout

\begin_layout Plain Layout

  0.04  -0.04   0.02  -0.01  -0.03  -0.35   1     -0.13  -0.04   0.19   0.6   -0.28
  -0.05   0.55  -0.08  -0.21 
\end_layout

\begin_layout Plain Layout

  0.02  -0.02  -0.1    0.08  -0.01  -0.05  -0.13   1     -0.2   -0.32   0.04   0.08
   0.15  -0.09   0      0.19 
\end_layout

\begin_layout Plain Layout

  0.06   0.09   0.06   0.06  -0.06  -0.13  -0.04  -0.2    1      0.14  -0.06   0.12
  -0.38  -0.04   0.28  -0.06 
\end_layout

\begin_layout Plain Layout

  0.15   0.16   0.12   0.01  -0.07   0.08   0.19  -0.32   0.14   1      0.06  -0.1
   -0.18   0.03  -0.09  -0.12 
\end_layout

\begin_layout Plain Layout

  0.03  -0.05   0.01  -0.01  -0.08  -0.33   0.6    0.04  -0.06   0.06   1      0.06
   0.04   0.52  -0.23  -0.24 
\end_layout

\begin_layout Plain Layout

 -0.05  -0.01  -0.05   0.02  -0.04  -0.03  -0.28   0.08   0.12  -0.1    0.06   1  
   -0.01  -0.19   0.05   0.25 
\end_layout

\begin_layout Plain Layout

  0.48   0.27   0.55   0.27   0.63   0.16  -0.05   0.15  -0.38  -0.18   0.04  -0.01
   1     -0.02   0.12  -0.04 
\end_layout

\begin_layout Plain Layout

  0.08  -0.01   0.03   0.02   0     -0.25   0.55  -0.09  -0.04   0.03   0.52  -0.19
  -0.02   1     -0.06  -0.19 
\end_layout

\begin_layout Plain Layout

  0.28   0.24   0.27   0.3    0.5    0.13  -0.08   0      0.28  -0.09  -0.23   0.05
   0.12  -0.06   1      0.14 
\end_layout

\begin_layout Plain Layout

 -0.1   -0.05  -0.11  -0.02  -0.06   0.25  -0.21   0.19  -0.06  -0.12  -0.24   0.25
  -0.04  -0.19   0.14   1    
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

eigenvalue	proportion	cumulative
\end_layout

\begin_layout Plain Layout

  4.31144	  0.26946	  0.26946	-0.436width-box-0.426x-box-0.417npix-0.4heigth-box-0.399y-
box...
\end_layout

\begin_layout Plain Layout

  2.62272	  0.16392	  0.43338	-0.509y-var-pix-0.467x2ybr-0.453xegvy+0.324x-var-pix+0.314
yegvx...
\end_layout

\begin_layout Plain Layout

  1.7285 	  0.10803	  0.54142	-0.556y2bar+0.452x2bar-0.433xybar+0.43 x-ege+0.184x2ybr...
\end_layout

\begin_layout Plain Layout

  1.35958	  0.08497	  0.62639	-0.497xy2br+0.421x-var-pix-0.383y2bar+0.322xybar-0.313x2ba
r...
\end_layout

\begin_layout Plain Layout

  1.05434	  0.0659 	  0.69229	0.613y-ege-0.445xy2br-0.371xybar-0.239y-box+0.232npix...
\end_layout

\begin_layout Plain Layout

  0.97429	  0.06089	  0.75318	-0.636yegvx-0.435x-var-pix-0.281xegvy-0.278xybar-0.257y-va
r-pix...
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Eigenvectors
\end_layout

\begin_layout Plain Layout

 V1	 V2	 V3	 V4	 V5	 V6	
\end_layout

\begin_layout Plain Layout

-0.426 	-0.0881	-0.0373	-0.0235	-0.1447	 0.042 	x-box
\end_layout

\begin_layout Plain Layout

-0.3987	-0.0243	-0.1375	-0.0605	-0.2388	 0.0507	y-box
\end_layout

\begin_layout Plain Layout

-0.4361	-0.0588	-0.0328	 0.064 	-0.073 	 0.0142	width-box
\end_layout

\begin_layout Plain Layout

-0.4001	-0.0171	-0.0455	-0.155 	-0.1254	 0.0333	heigth-box
\end_layout

\begin_layout Plain Layout

-0.4171	 0.032 	 0.0999	 0.0349	 0.232 	-0.0433	npix
\end_layout

\begin_layout Plain Layout

-0.0572	 0.3236	-0.0163	 0.4211	 0.0502	-0.435 	x-var-pix
\end_layout

\begin_layout Plain Layout

 0.0197	-0.5094	 0.0349	-0.0177	 0.1565	-0.2573	y-var-pix
\end_layout

\begin_layout Plain Layout

-0.0021	 0.123 	 0.4517	-0.3125	-0.0738	 0.1359	x2bar
\end_layout

\begin_layout Plain Layout

-0.0101	 0.003 	-0.5557	-0.3833	 0.1559	 0.1109	y2bar
\end_layout

\begin_layout Plain Layout

-0.0263	-0.1553	-0.4327	 0.3216	-0.3713	-0.278 	xybar
\end_layout

\begin_layout Plain Layout

 0.0305	-0.4672	 0.1843	-0.206 	-0.1763	-0.2248	x2ybr
\end_layout

\begin_layout Plain Layout

 0.0178	 0.1897	 0.0103	-0.4966	-0.4445	-0.2315	xy2br
\end_layout

\begin_layout Plain Layout

-0.2883	 0.0305	 0.4295	 0.1984	 0.0181	-0.0114	x-ege
\end_layout

\begin_layout Plain Layout

-0.0006	-0.4535	 0.0968	-0.0795	 0.2156	-0.2811	xegvy
\end_layout

\begin_layout Plain Layout

-0.2131	 0.1542	-0.1672	-0.2532	 0.6126	-0.2017	y-ege
\end_layout

\begin_layout Plain Layout

 0.0339	 0.3142	 0.096 	-0.2048	-0.0423	-0.6364	yegvx
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Ranked attributes:
\end_layout

\begin_layout Plain Layout

 0.731  1 -0.436width-box-0.426x-box-0.417npix-0.4heigth-box-0.399y-box...
\end_layout

\begin_layout Plain Layout

 0.567  2 -0.509y-var-pix-0.467x2ybr-0.453xegvy+0.324x-var-pix+0.314yegvx...
\end_layout

\begin_layout Plain Layout

 0.459  3 -0.556y2bar+0.452x2bar-0.433xybar+0.43 x-ege+0.184x2ybr...
\end_layout

\begin_layout Plain Layout

 0.374  4 -0.497xy2br+0.421x-var-pix-0.383y2bar+0.322xybar-0.313x2bar...
\end_layout

\begin_layout Plain Layout

 0.308  5 0.613y-ege-0.445xy2br-0.371xybar-0.239y-box+0.232npix...
\end_layout

\begin_layout Plain Layout

 0.247  6 -0.636yegvx-0.435x-var-pix-0.281xegvy-0.278xybar-0.257y-var-pix...
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

Selected attributes: 1,2,3,4,5,6 : 6
\end_layout

\end_inset


\end_layout

\begin_layout Standard
A file has been generated named 
\begin_inset Quotes eld
\end_inset

OCR.PCA70.arff
\begin_inset Quotes erd
\end_inset

 with the transformed data.
 Consequently, data is represented by 6 different variable, which correspond
 to a combination of the 16 original attributes that has been presented
 in previous sections.
\end_layout

\begin_layout Section
\begin_inset CommandInset label
LatexCommand label
name "sec:Weka-classification-algorithms"

\end_inset

Weka classification algorithms
\end_layout

\begin_layout Standard
Weka supports a great variety of supervised learning algorithms (classification)
 and they are classified in the following categories (for each one, at least
 one algorithm has been selected for testing purposes):
\end_layout

\begin_layout Itemize
Bayesian classifiers
\end_layout

\begin_deeper
\begin_layout Itemize
NaiveBayesSimple: Uses the normal distribution to model numeric attributes
 and the Bayes theorem for probabilistic classification.
\end_layout

\end_deeper
\begin_layout Itemize
Trees
\end_layout

\begin_deeper
\begin_layout Itemize
J48: Implements C4.5 algorithm for decision tree generation.
 
\end_layout

\end_deeper
\begin_layout Itemize
Rules
\end_layout

\begin_deeper
\begin_layout Itemize
OneR: Finds the one attribute to use to classify considering which makes
 fewest prediction errors.
\end_layout

\end_deeper
\begin_layout Itemize
Functions: classifiers that can be written down as mathematical equations
 in a reasonably natural way (although NaiveBayes is an exception).
 
\end_layout

\begin_deeper
\begin_layout Itemize
SimpleLogistic: Linear regression for non-continuous classes (which is our
 case with 26 letters).
\end_layout

\begin_layout Itemize
MultilayerPerceptron: Neural network with hidden layers.
\end_layout

\end_deeper
\begin_layout Itemize
Lazy classifiers
\end_layout

\begin_deeper
\begin_layout Itemize
IBk: Implementation of the K-Nearest Neighbours method (KNN).
\end_layout

\end_deeper
\begin_layout Itemize
Miscellaneous category
\end_layout

\begin_deeper
\begin_layout Itemize
Hyperpipes: Identifies classes by using the attribute ranges of the training
 data.
\end_layout

\end_deeper
\begin_layout Subsection
Bayesian classifier: NaiveBayesSimple
\end_layout

\begin_layout Standard
The NaiveBayes uses the Bayes theorem establishing a priori probability
 that an object 
\begin_inset Formula $\overrightarrow{x_{0}}$
\end_inset

 belongs to a group 
\begin_inset Formula $G_{i}$
\end_inset

:
\end_layout

\begin_layout Standard
\begin_inset Formula \begin{equation}
P\left(G_{i}|\overrightarrow{x_{0}}\right)=\frac{P\left(\overrightarrow{x_{0}}|G_{i}\right)\cdot P\left(G_{i}\right)}{\sum_{i=1}^{N}P\left(\overrightarrow{x_{0}}|G_{i}\right)\cdot P\left(G_{i}\right)}\end{equation}

\end_inset


\end_layout

\begin_layout Standard
It is worth to mention that numeric attributes are modeled by a normal distribut
ion.
\end_layout

\begin_layout Subsection
Tree: J48 (C4.5)
\end_layout

\begin_layout Standard
J48 implements C4.5 revision 8, an algorithm that generates decision trees
 that can be used for classification.
 It uses the concept of information entropy (measure of disorder/unpredictabilit
y).
\end_layout

\begin_layout Standard
At each node of the tree, C4.5 chooses one attribute of the data that most
 effectively splits its set of samples into subsets enriched in one class
 or the other.
 The algorithm is as follows:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize},numbers=left,numberstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

Check for base cases such as:
\end_layout

\begin_layout Plain Layout

	All the samples in the list belong to the same class.
\end_layout

\begin_layout Plain Layout

		Create a leaf node for the decision tree saying to choose that class.
\end_layout

\begin_layout Plain Layout

		 
\end_layout

\begin_layout Plain Layout

For each attribute a
\end_layout

\begin_layout Plain Layout

	Find the normalized information gain (difference in entropy) from splitting
 on a
\end_layout

\begin_layout Plain Layout

Let a_best be the attribute with the highest normalized information gain
\end_layout

\begin_layout Plain Layout

Create a decision node that splits on a_best
\end_layout

\begin_layout Plain Layout

Recur on the sublists obtained by splitting on a_best, and add those nodes
 as children of node
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# At the end
\end_layout

\begin_layout Plain Layout

Pruning tree after creation: 
\end_layout

\begin_layout Plain Layout

	Go back through the tree and attempts to remove branches that do not help
\end_layout

\begin_layout Plain Layout

	by replacing them with leaf nodes
\end_layout

\end_inset


\end_layout

\begin_layout Standard
For the case of study, the confidence threshold for pruning is one of the
 relevant parameters which will be set to 0.25 (general recommended value).
\end_layout

\begin_layout Subsection
Rules: OneR
\end_layout

\begin_layout Standard
The one-attribute-rule, or OneR, is an algorithm for finding association
 rules.
 The algorithm is as follows:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize},numbers=left,numberstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

For each attribute A:
\end_layout

\begin_layout Plain Layout

	For each value V of that attribute, create a rule:
\end_layout

\begin_layout Plain Layout

		1.
 count how often each class appears
\end_layout

\begin_layout Plain Layout

		2.
 find the most frequent class, c
\end_layout

\begin_layout Plain Layout

		3.
 make a rule "if A=V then C=c"
\end_layout

\begin_layout Plain Layout

	Calculate the error rate of this rule
\end_layout

\begin_layout Plain Layout

Pick the attribute whose rules produce the lowest error rate
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
Functions
\end_layout

\begin_layout Subsubsection
SimpleLogistic
\end_layout

\begin_layout Standard
SimpleLogistic builds logistic regression models for non-continuous classes
 (e.g.
 26 letters).
 Mathematically, the resulting model is:
\end_layout

\begin_layout Standard
\begin_inset Formula \begin{equation}
Pr\left(C_{k}|a_{1},a_{2},...,a_{n}\right)=\frac{1}{1+e^{-w_{0}-w_{1}a_{1}-...-w_{n}a_{n}}}\end{equation}

\end_inset


\end_layout

\begin_layout Standard
where 
\begin_inset Formula $C_{k}$
\end_inset

 is one possible class, 
\begin_inset Formula $\left(a_{1},...,a_{n}\right)$
\end_inset

 are the attributes of a new instance and 
\begin_inset Formula $\left(w_{0},...,w_{n}\right)$
\end_inset

 are the weights found from the training data.
 
\end_layout

\begin_layout Standard
SimpleLogistic fits the regression models by using the LogitBoost algorithm
\begin_inset Foot
status open

\begin_layout Plain Layout
http://en.wikipedia.org/wiki/LogitBoost
\end_layout

\end_inset

 with simple regression functions as base learners and determining how many
 iterations to perform using cross-validation
\begin_inset Foot
status open

\begin_layout Plain Layout
http://en.wikipedia.org/wiki/Cross-validation_(statistics)
\end_layout

\end_inset

 (technique for estimating the performance of a predictive model).
 
\end_layout

\begin_layout Subsubsection
MultilayerPerceptron 
\end_layout

\begin_layout Standard
MultilayerPerceptron is a neural network that trains using backpropagation
 (propagation of error for teaching of artificial neurons).
 For the case of study, the 
\begin_inset Quotes eld
\end_inset

autoBuild
\begin_inset Quotes erd
\end_inset

 option will be set so hidden layers are added and connected up automatically.
\end_layout

\begin_layout Subsection
Lazy: IBk
\end_layout

\begin_layout Standard
IBk implements the K-Nearest Neighbours method (KNN).
 Given a sample of objects classified on N groups, every new instance is
 classified by a majority vote of its neighbors, with the object being assigned
 to the class most common amongst its k nearest neighbors.
\end_layout

\begin_layout Standard
Weka IBk implementation uses Euclidean distance and the number of nearest
 neighbors (default 
\begin_inset Formula $k=1$
\end_inset

) can be specified.
 For the case of study 
\begin_inset Formula $k=5$
\end_inset

 will be used, which has been determined as a good choice after various
 manual tests.
\end_layout

\begin_layout Subsection
Miscellaneous: Hyperpipes
\end_layout

\begin_layout Standard
For each class, a Hyperpipe is constructed that contains all points of that
 class (essentially records the attribute limits observed for each category).
 Then, the new instances are classified according to the class that "most
 contains the instance".
\end_layout

\begin_layout Standard
This is an extremely simple algorithm that has the advantage of being extremely
 fast and works quite well when there are a huge amount of attributes.
\end_layout

\begin_layout Subsection
Metalearning algorithms
\end_layout

\begin_layout Subsubsection
Combining classifiers: Vote
\end_layout

\begin_layout Standard
Vote provides a method for combining classifiers by averaging their probability
 estimates (classification).
 The algorithm is as follows:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize},numbers=left,numberstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

# Model generation
\end_layout

\begin_layout Plain Layout

Let n be the number of instances in the training data.
\end_layout

\begin_layout Plain Layout

For each t classifier:
\end_layout

\begin_layout Plain Layout

	Apply learning algorithm.
\end_layout

\begin_layout Plain Layout

	Store the resulting model.
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# Classification
\end_layout

\begin_layout Plain Layout

For each of the t models:
\end_layout

\begin_layout Plain Layout

	Predict class of instance using model.
\end_layout

\begin_layout Plain Layout

Return class that has been predicted most often.
\end_layout

\end_inset


\end_layout

\begin_layout Standard
For the case of study, the average probability given by the following algorithms
 will be considered for object classification:
\end_layout

\begin_layout Itemize
NaiveBayesSimple: Probabilistic type
\end_layout

\begin_layout Itemize
J48: Decision tree type
\end_layout

\begin_layout Itemize
IBk: Geometric type
\end_layout

\begin_layout Standard
The classifiers has been chosen considering they are different enough as
 to complement each other efficiently.
\end_layout

\begin_layout Subsubsection
Boosting: AdaBoost.M1
\end_layout

\begin_layout Standard
Generally, it is considered a good option to combine multiple models generated
 by a given classifier when these models are significantly different from
 one another and each one treats a reasonable percentage of the data correctly.
 In that sense, the boosting method can perform this combination by explicitly
 seeking models that complement one another.
\end_layout

\begin_layout Standard
AdaBoost.M1 is a boosting algorithm designed specifically for classification
 and the algorithm is as follows:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize},numbers=left,numberstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

# Model generation
\end_layout

\begin_layout Plain Layout

Assign equal weight to each training instance.
\end_layout

\begin_layout Plain Layout

For each of t iterations:
\end_layout

\begin_layout Plain Layout

	Apply learning algorithm to weighted dataset and store resulting model.
\end_layout

\begin_layout Plain Layout

	Compute error e of model on weighted dataset and store error.
\end_layout

\begin_layout Plain Layout

	If e equal to zero, or e greater or equal to 0.5:
\end_layout

\begin_layout Plain Layout

		Terminate model generation.
\end_layout

\begin_layout Plain Layout

	For each instance in dataset:
\end_layout

\begin_layout Plain Layout

		If instance classified correctly by model:
\end_layout

\begin_layout Plain Layout

			Multiply weight of instance by e / (1 - e).
\end_layout

\begin_layout Plain Layout

	Normalize weight of all instances.
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# Classification
\end_layout

\begin_layout Plain Layout

Assign weight of zero to all classes.
\end_layout

\begin_layout Plain Layout

For each of the t (or less) models:
\end_layout

\begin_layout Plain Layout

	Add -log(e / (1 - e)) to weight of class predicted by model.
\end_layout

\begin_layout Plain Layout

Return class with highest weight.
\end_layout

\end_inset


\end_layout

\begin_layout Standard
It is worth to mention that in case any of the selected classifiers cannot
 handle weighted instances (e.g.
 C4.5 algorithm can accommodate weighted instances without modification but
 others don't), AdaBoost.M1 resamples the data with the weights before applying
 the classifier again.
\end_layout

\begin_layout Standard
For the case of study, the following classifiers will be used with AdaBoost.M1:
\end_layout

\begin_layout Itemize
NaiveBayesSimple: Probabilistic type
\end_layout

\begin_layout Itemize
J48: Decision tree type
\end_layout

\begin_layout Itemize
IBk: Geometric type
\end_layout

\begin_layout Section
Weka experimenter
\end_layout

\begin_layout Subsection
Input data
\end_layout

\begin_layout Standard
The following input files has been used with Weka experimenter, each of
 them has 9.940 objects:
\end_layout

\begin_layout Itemize
OCR.arff: Objects with the 16 original attributes presented in section
\begin_inset CommandInset ref
LatexCommand vref
reference "sec:Letter-Image-Recognition"

\end_inset


\end_layout

\begin_layout Itemize
OCR.PCA95.arff: Objects with 12 attributes determined after applying a Principal
 Components Analysis with 95% of covered variance, presented in section
 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Principal-Components-Analysis95:"

\end_inset

.
\end_layout

\begin_layout Itemize
OCR.PCA70.arff: Objects with 6 attributes determined after applying a Principal
 Components Analysis with 70% of covered variance, presented in section
 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Principal-Components-Analysis:70"

\end_inset

.
\end_layout

\begin_layout Standard
Weka divides each dataset into K folds/subsamples for cross-validation.
 Of the K subsamples, a single subsample is retained as the validation data
 for testing the model, and the remaining K − 1 subsamples are used as training
 data.
 For the case of study, 
\begin_inset Formula $K=10$
\end_inset

 has been established.
\end_layout

\begin_layout Subsection
Classification algorithms
\end_layout

\begin_layout Standard
The selected algorithms for object classification are those presented in
 section 
\begin_inset CommandInset ref
LatexCommand vref
reference "sec:Weka-classification-algorithms"

\end_inset

.
 Concrete list of algorithm with parameters:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize},numbers=left,numberstyle={\tiny}"
inline false
status open

\begin_layout Plain Layout

bayes.NaiveBayesSimple ''
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

trees.J48 '-C 0.25 -M 2'
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

rules.OneR '-B 6'
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

functions.SimpleLogistic '-I 0 -M 500 -H 50 -W 0.0'
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

functions.MultilayerPerceptron '-L 0.3 -M 0.2 -N 500 -V 0 -S 0 -E 20 -H a'
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

lazy.IBk '-K 5 -W 0 
\end_layout

\begin_layout Plain Layout

    -A "weka.core.neighboursearch.LinearNNSearch 
\end_layout

\begin_layout Plain Layout

    -A "weka.core.EuclideanDistance -R first-last""' 
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

misc.HyperPipes ''
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

meta.Vote '-S 1 
\end_layout

\begin_layout Plain Layout

    -B "bayes.NaiveBayesSimple " 
\end_layout

\begin_layout Plain Layout

    -B "trees.J48 -C 0.25 -M 2" 
\end_layout

\begin_layout Plain Layout

    -B "lazy.IBk -K 5 -W 0 
\end_layout

\begin_layout Plain Layout

        -A "weka.core.neighboursearch.LinearNNSearch 
\end_layout

\begin_layout Plain Layout

        -A "weka.core.EuclideanDistance -R first-last""" 
\end_layout

\begin_layout Plain Layout

    -R AVG'
\end_layout

\begin_layout Plain Layout

   
\end_layout

\begin_layout Plain Layout

meta.AdaBoostM1 '-Q -P 100 -S 1 -I 10 -W bayes.NaiveBayesSimple'
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

meta.AdaBoostM1 '-P 100 -S 1 -I 10 -W trees.J48 -- -C 0.25 -M 2'
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

meta.AdaBoostM1 '-P 100 -S 1 -I 10 -W lazy.IBk -- -K 5 -W 0 
\end_layout

\begin_layout Plain Layout

	-A "weka.core.neighboursearch.LinearNNSearch 
\end_layout

\begin_layout Plain Layout

	-A "weka.core.EuclideanDistance -R first-last""'
\end_layout

\end_inset


\end_layout

\begin_layout Standard
In order to get statistically meaningful results, the number of repetitions
 of each algorithm has been established to 10.
 For the case of study, 100 calls will be done of one classiﬁer with training
 data and tested against test data (10 folds/subsamples x 10 repetitions).
\end_layout

\begin_layout Subsection
Results analysis
\end_layout

\begin_layout Standard
Weka includes an experiment analyzer (T-Test) that can be used to study
 the results of experiments.
 For the case of study, the statistical signiﬁcance has been established
 to 0.05 which refers to the result of a pair-wise comparison of schemes
 using the corrected resampled T-Test.
 It is worth to mention that as the signiﬁcance level is decreased, the
 conﬁdence in the conclusion increases.
 
\end_layout

\begin_layout Standard
Results from analysis of the percentage of correct classification per algorithm
 and dataset (standard deviation in parenthesis):
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize}"
inline false
status open

\begin_layout Plain Layout

Dataset                   (1) 'OCR original' | (2)'OCR PCA 95' (3)'OCR PCA
 70'
\end_layout

\begin_layout Plain Layout

------------------------------------------------------------------------------
\end_layout

\begin_layout Plain Layout

meta.AdaBoostM1 (J48)    (100)   93.04(0.86) |   87.87(0.95) *   76.80(1.24) *
\end_layout

\begin_layout Plain Layout

lazy.IBk                 (100)   92.59(0.93) |   91.94(0.79) *   78.95(1.16) *
\end_layout

\begin_layout Plain Layout

meta.AdaBoostM1 (IBk)    (100)   92.42(0.96) |   91.85(0.82)     78.95(1.16) *
\end_layout

\begin_layout Plain Layout

meta.Vote                (100)   89.94(0.93) |   85.67(0.93) *   74.34(1.28) *
\end_layout

\begin_layout Plain Layout

trees.J48                (100)   84.17(1.26) |   73.97(1.44) *   67.66(1.42) *
\end_layout

\begin_layout Plain Layout

functions.MultilayerPerce(100)   81.46(1.22) |   77.11(1.51) *   66.42(1.63) *
\end_layout

\begin_layout Plain Layout

functions.SimpleLogistic (100)   77.24(1.02) |   72.05(1.24) *   50.17(1.39) *
\end_layout

\begin_layout Plain Layout

bayes.NaiveBayesSimple   (100)   63.69(1.44) |   64.65(1.34) v   48.48(1.51) *
\end_layout

\begin_layout Plain Layout

meta.AdaBoostM1 (NBayes) (100)   63.63(1.42) |   64.37(1.41)     48.33(1.56) *
\end_layout

\begin_layout Plain Layout

misc.HyperPipes          (100)   24.60(1.28) |   24.09(1.11)     17.98(0.87) *
\end_layout

\begin_layout Plain Layout

rules.OneR               (100)   16.98(0.90) |   16.92(1.06)     16.92(1.06)  
\end_layout

\begin_layout Plain Layout

------------------------------------------------------------------------------
\end_layout

\begin_layout Plain Layout

                                     (v/ /*) |         (1/4/6)        (0/1/10)
\end_layout

\end_inset


\end_layout

\begin_layout Standard
At the bottom of each column after the ﬁrst column is a count (v/ /*) of
 the number of times that a scheme was better than (v), the same as ( ),
 or worse than (*), the baseline dataset ('OCR original').
 
\end_layout

\begin_layout Standard
It is possible to conclude that applying PCA to the original dataset and
 reducing the number of attributes that define an object, affects the efficiency
 (in terms of correct classification) of any of the selected classifiers
 and the impact is not proportional for all of them.
\end_layout

\begin_layout Standard
On the other hand, despite that the execution of AdaBoost.M1 using J48 as
 classifier gets the better result for the original data, IBk is getting
 the best results for all the datasets as we can see in the overall algorithm
 ranking:
\end_layout

\begin_layout Description
‘>’ Number of times the scheme was significantly more than the other schemes
\end_layout

\begin_layout Description
‘<’ Number of times the scheme was significantly less than the other schemes
\end_layout

\begin_layout Description
‘>-<’ Difference between the above numbers
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

>-<   >   < Resultset
\end_layout

\begin_layout Plain Layout

 26  26   0 meta.AdaBoostM1 (IBk)
\end_layout

\begin_layout Plain Layout

 26  26   0 lazy.IBk
\end_layout

\begin_layout Plain Layout

 20  24   4 meta.AdaBoostM1 (J48)
\end_layout

\begin_layout Plain Layout

 12  21   9 meta.Vote (NBayes+J48+IBk)
\end_layout

\begin_layout Plain Layout

  3  16  13 functions.MultilayerPerceptron
\end_layout

\begin_layout Plain Layout

  3  16  13 trees.J48
\end_layout

\begin_layout Plain Layout

 -6  12  18 functions.SimpleLogistic
\end_layout

\begin_layout Plain Layout

-15   6  21 meta.AdaBoostM1 (NBayes)
\end_layout

\begin_layout Plain Layout

-15   6  21 bayes.NaiveBayesSimple
\end_layout

\begin_layout Plain Layout

-24   3  27 misc.HyperPipes
\end_layout

\begin_layout Plain Layout

-30   0  30 rules.OneR
\end_layout

\end_inset


\end_layout

\begin_layout Standard
Finally, the computational efficiency of each algorithm can be evaluated
 by the overall ranking of CPU time used for training and testing (lower
 position is better performance):
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

# Training time
\end_layout

\begin_layout Plain Layout

>-<   >   < Resultset
\end_layout

\begin_layout Plain Layout

 28  29   1 functions.SimpleLogistic
\end_layout

\begin_layout Plain Layout

 25  27   2 functions.MultilayerPerceptron
\end_layout

\begin_layout Plain Layout

 19  24   5 meta.AdaBoostM1 (IBk)
\end_layout

\begin_layout Plain Layout

 12  21   9 meta.AdaBoostM1 (J48)
\end_layout

\begin_layout Plain Layout

  2  16  14 meta.AdaBoostM1 (NaiveBayes)
\end_layout

\begin_layout Plain Layout

  1  15  14 trees.J48
\end_layout

\begin_layout Plain Layout

 -3  13  16 meta.Vote (NBayes+J48+IBk)
\end_layout

\begin_layout Plain Layout

-12   9  21 rules.OneR
\end_layout

\begin_layout Plain Layout

-18   6  24 bayes.NaiveBayesSimple
\end_layout

\begin_layout Plain Layout

-27   0  27 misc.HyperPipes
\end_layout

\begin_layout Plain Layout

-27   0  27 lazy.IBk
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize}"
inline false
status open

\begin_layout Plain Layout

# Testing time
\end_layout

\begin_layout Plain Layout

>-<   >   < Resultset
\end_layout

\begin_layout Plain Layout

 30  30   0 meta.AdaBoostM1 (IBk)
\end_layout

\begin_layout Plain Layout

 23  26   3 meta.Vote (NBayes+J48+IBk)
\end_layout

\begin_layout Plain Layout

 19  24   5 lazy.IBk
\end_layout

\begin_layout Plain Layout

  7  18  11 functions.SimpleLogistic
\end_layout

\begin_layout Plain Layout

  7  18  11 meta.AdaBoostM1 (NaiveBayes)
\end_layout

\begin_layout Plain Layout

  2  15  13 meta.AdaBoostM1 (J48)
\end_layout

\begin_layout Plain Layout

 -5  11  16 bayes.NaiveBayesSimple
\end_layout

\begin_layout Plain Layout

-11   9  20 functions.MultilayerPerceptron
\end_layout

\begin_layout Plain Layout

-24   0  24 misc.HyperPipes
\end_layout

\begin_layout Plain Layout

-24   0  24 rules.OneR
\end_layout

\begin_layout Plain Layout

-24   0  24 trees.J48
\end_layout

\end_inset


\end_layout

\begin_layout Standard
In order to have a better understanding of how much better/worst is each
 algorithm, here is the time expressed in minutes of a single execution
 using one core of a CPU Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz.
 For obtaining the total time consumed for this study, it should be multiplied
 by 100 (10 folds x 10 iterations):
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize}"
inline false
status open

\begin_layout Plain Layout

# Testing time
\end_layout

\begin_layout Plain Layout

Dataset                   (1) 'OCR original'   | (2) 'OCR PCA 95'  (3) 'OCR
 PCA 70'
\end_layout

\begin_layout Plain Layout

--------------------------------------------------------------------------------
---
\end_layout

\begin_layout Plain Layout

meta.AdaBoostM1 (J48)    (100)     5.62( 0.05) |    14.83( 0.10) v    8.63( 0.05)
 v
\end_layout

\begin_layout Plain Layout

lazy.IBk                 (100)     0.00( 0.00) |     0.00( 0.00)      0.00( 0.00)
  
\end_layout

\begin_layout Plain Layout

meta.AdaBoostM1 (IBk)    (100)   134.69(23.08) |   106.44(22.37) *   53.60( 8.60)
 *
\end_layout

\begin_layout Plain Layout

meta.Vote                (100)     0.49( 0.01) |     1.44( 0.02) v    0.82( 0.01)
 v
\end_layout

\begin_layout Plain Layout

trees.J48                (100)     0.52( 0.02) |     1.45( 0.03) v    0.85( 0.02)
 v
\end_layout

\begin_layout Plain Layout

functions.MultilayerPerce(100)   147.14( 5.89) |   122.71( 0.84) *   97.04( 0.75)
 *
\end_layout

\begin_layout Plain Layout

functions.SimpleLogistic (100)   184.13(51.42) |   191.67(58.11)     76.25(19.71)
 *
\end_layout

\begin_layout Plain Layout

bayes.NaiveBayesSimple   (100)     0.01( 0.01) |     0.01( 0.00)      0.00( 0.01)
 *
\end_layout

\begin_layout Plain Layout

meta.AdaBoostM1 (NBayes) (100)     2.78( 0.67) |     2.28( 0.47)      0.14( 0.01)
 *
\end_layout

\begin_layout Plain Layout

misc.HyperPipes          (100)     0.00( 0.00) |     0.00( 0.00)      0.00( 0.00)
  
\end_layout

\begin_layout Plain Layout

rules.OneR               (100)     0.02( 0.01) |     0.02( 0.01)      0.01( 0.00)
 *
\end_layout

\begin_layout Plain Layout

--------------------------------------------------------------------------------
---
\end_layout

\begin_layout Plain Layout

                                       (v/ /*) |           (3/6/2)     
     (3/2/6)
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize}"
inline false
status open

\begin_layout Plain Layout

# Testing time
\end_layout

\begin_layout Plain Layout

Dataset                   (1)  OCR original |(2) OCR PCA 95 (3) OCR PCA
 70
\end_layout

\begin_layout Plain Layout

---------------------------------------------------------------------------
\end_layout

\begin_layout Plain Layout

meta.AdaBoostM1 (IBk)    (100)   0.04(0.01) |   0.04(0.01)     0.04(0.01)  
\end_layout

\begin_layout Plain Layout

lazy.IBk                 (100)   1.22(0.02) |   0.88(0.02) *   0.64(0.01) *
\end_layout

\begin_layout Plain Layout

meta.AdaBoostM1 (NBayes) (100)   7.00(1.34) |   5.61(1.32) *   2.73(0.50) *
\end_layout

\begin_layout Plain Layout

meta.Vote                (100)   1.26(0.02) |   0.91(0.02) *   0.65(0.02) *
\end_layout

\begin_layout Plain Layout

trees.J48                (100)   0.00(0.00) |   0.00(0.01)     0.00(0.01)  
\end_layout

\begin_layout Plain Layout

functions.MultilayerPerce(100)   0.01(0.00) |   0.01(0.00)     0.01(0.00)  
\end_layout

\begin_layout Plain Layout

functions.SimpleLogistic (100)   0.05(0.01) |   0.06(0.01) v   0.03(0.01) *
\end_layout

\begin_layout Plain Layout

bayes.NaiveBayesSimple   (100)   0.04(0.01) |   0.03(0.00) *   0.01(0.01) *
\end_layout

\begin_layout Plain Layout

meta.AdaBoostM1 (J48)    (100)   0.13(0.04) |   0.11(0.03)     0.02(0.00) *
\end_layout

\begin_layout Plain Layout

misc.HyperPipes          (100)   0.00(0.00) |   0.00(0.00)     0.00(0.00)  
\end_layout

\begin_layout Plain Layout

rules.OneR               (100)   0.00(0.00) |   0.00(0.00)     0.00(0.00)  
\end_layout

\begin_layout Plain Layout

---------------------------------------------------------------------------
\end_layout

\begin_layout Plain Layout

                                    (v/ /*) |        (1/6/4)        (0/5/6)
\end_layout

\end_inset


\end_layout

\begin_layout Standard
IBk is the fastest algorithm in the training process but comparative slower
 for testing (classifying new objects).
 If it is important to choose an algorithm with a fast testing process and
 good classification capacities, the boosted version of J48 should be considered.
\end_layout

\begin_layout Standard
With respect to the metalearning algorithms, Vote has been used to combine
 the following classifiers:
\end_layout

\begin_layout Itemize
NaiveBayesSimple: Probabilistic type
\end_layout

\begin_layout Itemize
J48: Decision tree type
\end_layout

\begin_layout Itemize
IBk: Geometric type
\end_layout

\begin_layout Standard
Percentage of correction and CPU time consumption for this Vote combination
 is worst that the offered by the best individual classifier (IBk), therefore
 its not a good choice for this case of study.
\end_layout

\begin_layout Standard
On the other hand, despite that AdaBoost.M1 with NaiveBayesSimple and IBk
 does not present any improvement at all, when applied to J48 the results
 are improved significantly (from 84.17% to 93.04% with the original dataset)
 increasing the CPU time consumption.
 
\end_layout

\begin_layout Section
Neural networks
\end_layout

\begin_layout Subsection
\begin_inset CommandInset label
LatexCommand label
name "sub:Neural-Input-data"

\end_inset

Input data
\end_layout

\begin_layout Standard
A ruby script has been implemented (code in 
\begin_inset CommandInset ref
LatexCommand vref
reference "sec:Annex-II.-DataTransform"

\end_inset

) in order to transform the following input files (each of them with 9.940
 objects):
\end_layout

\begin_layout Itemize
OCR.arff: Objects with the 16 original attributes presented in section 
\begin_inset CommandInset ref
LatexCommand vref
reference "sec:Letter-Image-Recognition"

\end_inset


\end_layout

\begin_layout Itemize
OCR.PCA95.arff: Objects with 12 attributes determined after applying a Principal
 Components Analysis with 95% of covered variance, presented in section
 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Principal-Components-Analysis95:"

\end_inset

.
\end_layout

\begin_layout Itemize
OCR.PCA70.arff: Objects with 6 attributes determined after applying a Principal
 Components Analysis with 70% of covered variance, presented in section
 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Principal-Components-Analysis:70"

\end_inset

.
\end_layout

\begin_layout Standard
The transformations that the script performs are:
\end_layout

\begin_layout Enumerate
Finds the maximum and minimum value for each attribute
\end_layout

\begin_layout Enumerate
Rescales/normalizes the values between 0..1 for each attribute
\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Formula $new\, value=\frac{value-minimum}{maximum-minimum}\,$
\end_inset


\end_layout

\end_deeper
\begin_layout Enumerate
Builds a binary representation of the letter (class).
 For example:
\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

V K W L A X M B Y N C Z O D P E Q F R G S H T I U J
\end_layout

\begin_layout Plain Layout

0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Enumerate
Defines a numeric representation between 0 and 1 with increments of 0.04
 (1/25)
\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

        V K W L A X M B Y N C Z O D P E Q F R G S H T I U J
\end_layout

\begin_layout Plain Layout

Num = 0.0 ...............................................
 1.0
\end_layout

\end_inset


\end_layout

\end_deeper
\begin_layout Enumerate
Writes new files with the required JavaNNS/SNNS format
\end_layout

\begin_deeper
\begin_layout Enumerate
Directories:
\end_layout

\begin_deeper
\begin_layout Enumerate
binary_classes: output neuron (class/letter) represented in binary form
\end_layout

\begin_layout Enumerate
numeric_classes: output neuron (class/letter) represented in numeric form
\end_layout

\end_deeper
\begin_layout Enumerate
Files on each directory: OCR.pat, OCR.PCA95.pat and OCR.PCA70.pat
\end_layout

\end_deeper
\begin_layout Enumerate
For each of the above directory/files, generates subdatasets for training
 (70% of the original data) and validating (30%)
\end_layout

\begin_deeper
\begin_layout Enumerate
Files on each directory: 
\end_layout

\begin_deeper
\begin_layout Enumerate
OCR.Train.pat, OCR.Test.pat
\end_layout

\begin_layout Enumerate
OCR.PCA95.Train.pat, OCR.PCA95.Test.pat
\end_layout

\begin_layout Enumerate
OCR.PCA70.Train.pat, OCR.PCA70.Test.pat
\end_layout

\end_deeper
\end_deeper
\begin_layout Enumerate
Saves the conversion table of letters representation:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

--------------------------------------------------------------------------------
---
\end_layout

\begin_layout Plain Layout

* Conversion table: Class, numeric and binary values                   
           *
\end_layout

\begin_layout Plain Layout

--------------------------------------------------------------------------------
---
\end_layout

\begin_layout Plain Layout

Class		Num.		V K W L A X M B Y N C Z O D P E Q F R G S H T I U J
\end_layout

\begin_layout Plain Layout

--------------------------------------------------------------------------------
---
\end_layout

\begin_layout Plain Layout

V	=	0.0	=	1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

K	=	0.04	=	0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

W	=	0.08	=	0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

L	=	0.12	=	0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

A	=	0.16	=	0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

X	=	0.2	=	0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

M	=	0.24	=	0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

B	=	0.28	=	0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

Y	=	0.32	=	0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

N	=	0.36	=	0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

C	=	0.4	=	0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

Z	=	0.44	=	0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

O	=	0.48	=	0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

D	=	0.52	=	0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

P	=	0.56	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

E	=	0.6	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

Q	=	0.64	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

F	=	0.68	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

R	=	0.72	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

G	=	0.76	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

S	=	0.8	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
\end_layout

\begin_layout Plain Layout

H	=	0.84	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
\end_layout

\begin_layout Plain Layout

T	=	0.88	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
\end_layout

\begin_layout Plain Layout

I	=	0.92	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
\end_layout

\begin_layout Plain Layout

U	=	0.96	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
\end_layout

\begin_layout Plain Layout

J	=	1.0	=	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
\end_layout

\begin_layout Plain Layout

--------------------------------------------------------------------------------
---
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
General design decisions
\end_layout

\begin_layout Subsubsection
Neuron
\end_layout

\begin_layout Standard
The chosen activation function is Logistic, which applies the following
 equation to the input value (
\begin_inset Formula $x$
\end_inset

) generating a smoothed step-function bound between 0 and 1 :
\end_layout

\begin_layout Standard
\begin_inset Formula \begin{equation}
y=\frac{1}{1+e^{\sum x_{inputs}}}\end{equation}

\end_inset


\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename LogisticFunction.png
	lyxscale 50
	scale 35

\end_inset


\end_layout

\begin_layout Standard
On the other hand, Identity has been established as the output function
 (
\begin_inset Formula $Identity\left(y\right)=y_{output}$
\end_inset

).
 Therefore, each neuron will output the value calculated by the equation
 above.
\end_layout

\begin_layout Subsubsection
Patterns (data)
\end_layout

\begin_layout Standard
The data is divided into a training set (for estimating the weights) and
 a validation set (for estimating the optimal number of hidden nodes).
 In section 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Neural-Input-data"

\end_inset

 it has been already explained how this data has been created.
\end_layout

\begin_layout Standard
The shuffle option will be activated, so JavaNNS will randomly shuffle the
 patterns before each cycle of backpropagation training.
 Thanks to that it is possible to reduce the probabilities for the network
 to oscillate constantly between certain states by the use of equally ordered
 patterns for each training epoch.
\end_layout

\begin_layout Subsubsection
Layers
\end_layout

\begin_layout Standard
Each layer will be composed by the following number of neurons:
\end_layout

\begin_layout Itemize
Input layer (
\begin_inset Formula $N_{input}$
\end_inset

): 26, 12 and 6 attributes depending if the input data is original, PCA
 95% or PCA 70%.
\end_layout

\begin_layout Itemize
Output layer (
\begin_inset Formula $N_{output}$
\end_inset

): 26 or 1 depending if the letter is going to be represented in binary
 or numeric.
\end_layout

\begin_layout Itemize
Hidden layer (
\begin_inset Formula $N_{hidden}$
\end_inset

): the number of neurons is recommended to be placed between the following
 range:
\end_layout

\begin_deeper
\begin_layout Standard
\begin_inset Formula \[
\frac{N_{input}+N_{output}}{2}<N_{hidden}<N_{input}+N_{output}\]

\end_inset


\end_layout

\begin_layout Itemize
The initial strategy defined consist on choosing the largest number among
 input and output neurons 
\begin_inset Formula $N_{hidden}=max\left(N_{input},N_{output}\right)$
\end_inset


\end_layout

\end_deeper
\begin_layout Subsubsection
Learning
\end_layout

\begin_layout Standard
Backpropagation is the chosen learning algorithms that iteratively will
 alter the value of the weights until some error function is minimized,
 it will use a learning rate 
\begin_inset Formula $\eta=0.2$
\end_inset

 and a maximum difference between the desired output and the real output
 of 
\begin_inset Formula $d_{max}=0.1$
\end_inset

.
 Each iteration is called a cycle, and a minimum of 1.000 cycles will be
 done for each test (limited by computational power and time).
 As update method 
\begin_inset Quotes eld
\end_inset

Topological_Order
\begin_inset Quotes erd
\end_inset

 has been chosen with one update step (sufficient to propagate information
 from input to output).
\end_layout

\begin_layout Standard
In this process, while the training error reduces monotonically, 
\begin_inset Formula $d_{max}$
\end_inset

 will have an important role in order to avoid overfitting because it establishe
s a limit for which error should not be propagated.
 Additionally, the validation pattern helps to control this kind of problems.
\end_layout

\begin_layout Standard
On the other hand, the learning algorithm can get caught in a local minimum.
 To validate in simple way that this is not apparently happening, several
 different weights initializations will be performed (random weights between
 -1 and 1).
\end_layout

\begin_layout Subsubsection
Pruning
\end_layout

\begin_layout Standard
Networks can be pruned (neuron and connection elimination) in order to improve
 efficiency.
 For the cases where this option is applied, it will be performed a Magnitude
 Based Pruning.
 This is the simplest weight pruning algorithm: After each training, the
 link with the smallest weight is removed.
 It's worth to mention that though this method is very simple, it is known
 to rarely yield worse results than the more sophisticated algorithms.
\end_layout

\begin_layout Subsection
Networks with binary representation of letters
\end_layout

\begin_layout Subsubsection
Original
\end_layout

\begin_layout Standard
The following network has been designed and trained (it does not fit entirely
 in the image, it has 26 hidden neurons and 26 output neurons):
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Binary - OCR Original - Network.png
	lyxscale 50
	scale 50

\end_inset


\end_layout

\begin_layout Standard
During the training, the evolution of the mean square error was the following
 (red line for the test/validation pattern):
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Binary - OCR Original - Error.png
	scale 50

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

Step 100 MSE:	0.5734590240007755	validation:	0.2613144688443159
\end_layout

\begin_layout Plain Layout

Step 200 MSE:	0.4994512566938087	validation:	0.23625497287108066
\end_layout

\begin_layout Plain Layout

Step 300 MSE:	0.46331340910043595	validation:	0.22299200476295272
\end_layout

\begin_layout Plain Layout

Step 400 MSE:	0.4400385057742287	validation:	0.2222846560155202
\end_layout

\begin_layout Plain Layout

Step 500 MSE:	0.4256005188029217	validation:	0.21828318953434148
\end_layout

\begin_layout Plain Layout

Step 600 MSE:	0.41551739637040996	validation:	0.21884316969525486
\end_layout

\begin_layout Plain Layout

Step 700 MSE:	0.40219335217031355	validation:	0.2136290030220385
\end_layout

\begin_layout Plain Layout

Step 800 MSE:	0.3940331032418469	validation:	0.213942795772028
\end_layout

\begin_layout Plain Layout

Step 900 MSE:	0.3885376058433937	validation:	0.21444517937704352
\end_layout

\begin_layout Plain Layout

Step 1000 MSE:	0.3843637181159876	validation:	0.20900531362000127
\end_layout

\end_inset


\end_layout

\begin_layout Subsubsection
PCA 95 %
\end_layout

\begin_layout Standard
The following network has been designed and trained (it does not fit entirely
 in the image, it has 26 hidden neurons and 26 output neurons):
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Binary - OCR PCA 95 - Network.png
	lyxscale 50
	scale 50

\end_inset


\end_layout

\begin_layout Standard
During the training, the evolution of the mean square error was the following
 (red line for the test/validation pattern):
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Binary - OCR PCA 95 - Error.png
	scale 50

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

Step 100 MSE:	0.7010856643768864	validation:	0.33005264251524774
\end_layout

\begin_layout Plain Layout

Step 200 MSE:	0.5932119818520498	validation:	0.280224662591434
\end_layout

\begin_layout Plain Layout

Step 300 MSE:	0.5524064389592765	validation:	0.2702997771786972
\end_layout

\begin_layout Plain Layout

Step 400 MSE:	0.5250195427120011	validation:	0.2706575553581908
\end_layout

\begin_layout Plain Layout

Step 500 MSE:	0.510730438948797	validation:	0.2771468491941231
\end_layout

\begin_layout Plain Layout

Step 600 MSE:	0.4988691507770582	validation:	0.2713542812866784
\end_layout

\begin_layout Plain Layout

Step 700 MSE:	0.48919501710785546	validation:	0.2662246059363996
\end_layout

\begin_layout Plain Layout

Step 800 MSE:	0.48003352144114686	validation:	0.2618340045153735
\end_layout

\begin_layout Plain Layout

Step 900 MSE:	0.47384391800018866	validation:	0.26418741943850604
\end_layout

\begin_layout Plain Layout

Step 1000 MSE:	0.47207291601169515	validation:	0.2579010439590669
\end_layout

\end_inset


\end_layout

\begin_layout Subsubsection
PCA 70 %
\end_layout

\begin_layout Standard
The following network has been designed and trained (it does not fit entirely
 in the image, it has 26 hidden neurons and 26 output neurons):
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Binary - OCR PCA 70 - Network.png
	lyxscale 50
	scale 50

\end_inset


\end_layout

\begin_layout Standard
During the training, the evolution of the mean square error was the following
 (red line for the test/validation pattern):
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Binary - OCR PCA 70 - Error.png
	scale 50

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

Step 100 MSE:	1.1341376710785547	validation:	0.4836847009793134
\end_layout

\begin_layout Plain Layout

Step 200 MSE:	1.0188979744351525	validation:	0.4454418978061075
\end_layout

\begin_layout Plain Layout

Step 300 MSE:	0.9731453499643695	validation:	0.43454955809073187
\end_layout

\begin_layout Plain Layout

Step 400 MSE:	0.9484801058957915	validation:	0.42444621341329225
\end_layout

\begin_layout Plain Layout

Step 500 MSE:	0.9275684215972921	validation:	0.4142286580813003
\end_layout

\begin_layout Plain Layout

Step 600 MSE:	0.9145770619812625	validation:	0.41391398521336353
\end_layout

\begin_layout Plain Layout

Step 700 MSE:	0.9078236508897133	validation:	0.4181919315371395
\end_layout

\begin_layout Plain Layout

Step 800 MSE:	0.899911431479502	validation:	0.4048590042861335
\end_layout

\begin_layout Plain Layout

Step 900 MSE:	0.8893915249308351	validation:	0.40511759521975604
\end_layout

\begin_layout Plain Layout

Step 1000 MSE:	0.8832434712441315	validation:	0.4077373583951626
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
Networks with numeric representation of letters
\end_layout

\begin_layout Subsubsection
Original
\end_layout

\begin_layout Standard
The following network has been designed and trained:
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Numeric - OCR Original - Network.png
	lyxscale 50
	scale 50

\end_inset


\end_layout

\begin_layout Standard
During the training, the evolution of the mean square error was the following
 (red line for the test/validation pattern):
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Numeric - OCR Original - Error.png
	scale 50

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

Step 100 MSE:	0.07316514647782528	validation:	0.03274918881780265
\end_layout

\begin_layout Plain Layout

Step 200 MSE:	0.06685264889303268	validation:	0.031110199404434418
\end_layout

\begin_layout Plain Layout

Step 300 MSE:	0.061765377830131835	validation:	0.028840776900170555
\end_layout

\begin_layout Plain Layout

Step 400 MSE:	0.058764636156784456	validation:	0.027238639867361723
\end_layout

\begin_layout Plain Layout

Step 500 MSE:	0.05699404352547577	validation:	0.02738178695791284
\end_layout

\begin_layout Plain Layout

Step 600 MSE:	0.05502045066623701	validation:	0.02680796540718923
\end_layout

\begin_layout Plain Layout

Step 700 MSE:	0.05338100584300071	validation:	0.02661614318888592
\end_layout

\begin_layout Plain Layout

Step 800 MSE:	0.051580739932760626	validation:	0.026547312336748355
\end_layout

\begin_layout Plain Layout

Step 900 MSE:	0.05016698395942058	validation:	0.025508220526773925
\end_layout

\begin_layout Plain Layout

Step 1000 MSE:	0.04939202475595762	validation:	0.025375765334192654
\end_layout

\end_inset


\end_layout

\begin_layout Subsubsection
PCA 95 %
\end_layout

\begin_layout Standard
The following network has been designed and trained:
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Numeric - OCR PCA 95 - Network.png
	lyxscale 50
	scale 50

\end_inset


\end_layout

\begin_layout Standard
During the training, the evolution of the mean square error was the following
 (red line for the test/validation pattern):
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Numeric - OCR PCA 95 - Error.png
	scale 50

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

Step 100 MSE:	0.09940173880195234	validation:	0.04502674207680982
\end_layout

\begin_layout Plain Layout

Step 200 MSE:	0.09305192319280264	validation:	0.04236522446855613
\end_layout

\begin_layout Plain Layout

Step 300 MSE:	0.08753950910868859	validation:	0.04031304782225253
\end_layout

\begin_layout Plain Layout

Step 400 MSE:	0.08033461286108579	validation:	0.036873754121408135
\end_layout

\begin_layout Plain Layout

Step 500 MSE:	0.07653567584707463	validation:	0.035841219701837325
\end_layout

\begin_layout Plain Layout

Step 600 MSE:	0.07475118042237802	validation:	0.03562485396182433
\end_layout

\begin_layout Plain Layout

Step 700 MSE:	0.07318759460244541	validation:	0.034924697108431844
\end_layout

\begin_layout Plain Layout

Step 800 MSE:	0.07165655267870243	validation:	0.0348906718509298
\end_layout

\begin_layout Plain Layout

Step 900 MSE:	0.07014810727155904	validation:	0.03390952710894272
\end_layout

\begin_layout Plain Layout

Step 1000 MSE:	0.06980477428372317	validation:	0.03375271772234972
\end_layout

\end_inset


\end_layout

\begin_layout Subsubsection
\begin_inset CommandInset label
LatexCommand label
name "sub:Numeric-PCA-70-%"

\end_inset

PCA 70 %
\end_layout

\begin_layout Standard
In the design of every presented network, the initial strategy for establishing
 the number of neurons in the hidden layer was determined by the maximum
 number: 
\begin_inset Formula \[
N_{hidden}=max\left(N_{input},N_{output}\right)\]

\end_inset


\end_layout

\begin_layout Standard
For this case, which is an easy to compute network in terms of CPU time
 consumption, three scenarios has been created in order to evaluate the
 correctness of the strategy.
 Three networks has been defined using the recommended bounds for the number
 of neurons in the hidden layer:
\end_layout

\begin_layout Standard
\begin_inset Formula \[
\frac{N_{input}+N_{output}}{2}<N_{hidden}<N_{input}+N_{output}\]

\end_inset


\end_layout

\begin_layout Standard
Resulting in three networks with 7, 6 and 4 hidden neurons respectively.
\end_layout

\begin_layout Standard
Additionally, pruning (removes neurons and connections) has been applied
 to the 6 hidden neurons version in order to evaluate this possibility.
\end_layout

\begin_layout Paragraph*
7 neurons in the hidden layer
\end_layout

\begin_layout Standard
The following network has been designed and trained:
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Numeric - OCR PCA 70 - 7 hidden neurons -Network.png
	lyxscale 50
	scale 50

\end_inset


\end_layout

\begin_layout Standard
During the training, the evolution of the mean square error was the following
 (red line for the test/validation pattern):
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Numeric - OCR PCA 70 - 7 hidden neurons -Error.png
	scale 50

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

Step 100 MSE:	0.13660209343626864	validation:	0.0591191497127295
\end_layout

\begin_layout Plain Layout

Step 200 MSE:	0.13051012168387932	validation:	0.05746487592547472
\end_layout

\begin_layout Plain Layout

Step 300 MSE:	0.12306074197463426	validation:	0.05503580667763089
\end_layout

\begin_layout Plain Layout

Step 400 MSE:	0.11800580501236586	validation:	0.05271678799194909
\end_layout

\begin_layout Plain Layout

Step 500 MSE:	0.11717367396108422	validation:	0.05187454581820349
\end_layout

\begin_layout Plain Layout

Step 600 MSE:	0.11655469519591508	validation:	0.05173947329812206
\end_layout

\begin_layout Plain Layout

Step 700 MSE:	0.11599225889189302	validation:	0.052479913456978854
\end_layout

\begin_layout Plain Layout

Step 800 MSE:	0.11596967260922304	validation:	0.05422891761375545
\end_layout

\begin_layout Plain Layout

Step 900 MSE:	0.11561868975899668	validation:	0.05160117197324572
\end_layout

\begin_layout Plain Layout

Step 1000 MSE:	0.11547352146734574	validation:	0.05138052845065183
\end_layout

\end_inset


\end_layout

\begin_layout Paragraph*
6 neurons in the hidden layer
\end_layout

\begin_layout Standard
The following network has been designed and trained:
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Numeric - OCR PCA 70 - Network.png
	lyxscale 50
	scale 50

\end_inset


\end_layout

\begin_layout Standard
During the training, the evolution of the mean square error was the following
 (red line for the test/validation pattern):
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Numeric - OCR PCA 70 - Error.png
	scale 50

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

Step 100 MSE:	0.13697006460966318	validation:	0.05985763007406417
\end_layout

\begin_layout Plain Layout

Step 200 MSE:	0.1320928603030946	validation:	0.05799257827236859
\end_layout

\begin_layout Plain Layout

Step 300 MSE:	0.1309209832563087	validation:	0.05837907797533901
\end_layout

\begin_layout Plain Layout

Step 400 MSE:	0.1285985362042044	validation:	0.05727121415832233
\end_layout

\begin_layout Plain Layout

Step 500 MSE:	0.12701329027223235	validation:	0.05551885838959539
\end_layout

\begin_layout Plain Layout

Step 600 MSE:	0.12496408914096559	validation:	0.05474457974245211
\end_layout

\begin_layout Plain Layout

Step 700 MSE:	0.12101870459410106	validation:	0.0519551738327098
\end_layout

\begin_layout Plain Layout

Step 800 MSE:	0.12009227811530643	validation:	0.050503199249206175
\end_layout

\begin_layout Plain Layout

Step 900 MSE:	0.11790827566309314	validation:	0.052013686325308624
\end_layout

\begin_layout Plain Layout

Step 1000 MSE:	0.11635975930452506	validation:	0.051971885839778256
\end_layout

\end_inset


\end_layout

\begin_layout Paragraph
4 neurons in the hidden layer
\end_layout

\begin_layout Standard
The following network has been designed and trained:
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Numeric - OCR PCA 70 - 4 hidden neurons -Network.png
	lyxscale 50
	scale 50

\end_inset


\end_layout

\begin_layout Standard
During the training, the evolution of the mean square error was the following
 (red line for the test/validation pattern):
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Numeric - OCR PCA 70 - 4 hidden neurons -Error.png
	scale 50

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

Step 100 MSE:	0.13853663362007984	validation:	0.06079521153614395
\end_layout

\begin_layout Plain Layout

Step 200 MSE:	0.13670098389818075	validation:	0.06086290898057616
\end_layout

\begin_layout Plain Layout

Step 300 MSE:	0.13641086222740087	validation:	0.05985930332155694
\end_layout

\begin_layout Plain Layout

Step 400 MSE:	0.13615051105788376	validation:	0.060952246069188566
\end_layout

\begin_layout Plain Layout

Step 500 MSE:	0.13564532335615254	validation:	0.05955790897730131
\end_layout

\begin_layout Plain Layout

Step 600 MSE:	0.13592388068646252	validation:	0.06071935764980508
\end_layout

\begin_layout Plain Layout

Step 700 MSE:	0.1349311588115935	validation:	0.06359274318600404
\end_layout

\begin_layout Plain Layout

Step 800 MSE:	0.1345791423344756	validation:	0.05917259129320192
\end_layout

\begin_layout Plain Layout

Step 900 MSE:	0.13402450428482351	validation:	0.059513161120040556
\end_layout

\begin_layout Plain Layout

Step 1000 MSE:	0.13392397639417233	validation:	0.05920344147403955
\end_layout

\end_inset


\end_layout

\begin_layout Paragraph*
Pruning
\end_layout

\begin_layout Standard
Additionally, in this case the network version with 6 hidden neurons has
 been pruned searching for efficiency improvements:
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Numeric - OCR PCA 70 - Pruned - Network.png
	lyxscale 50
	scale 50

\end_inset


\end_layout

\begin_layout Standard
The evolution of the mean square error for the pruned network (blue is the
 pruned version, black is the 6 hidden neuron version and red is the verificatio
n pattern):
\end_layout

\begin_layout Standard
\noindent
\align center
\begin_inset Graphics
	filename networks/Numeric - OCR PCA 70 - Pruned - Error.png
	scale 50

\end_inset


\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

Step 100 MSE:	0.14501143621167106	validation:	0.06109176011472481
\end_layout

\begin_layout Plain Layout

Step 200 MSE:	0.13774829355363954	validation:	0.06098788061212326
\end_layout

\begin_layout Plain Layout

Step 300 MSE:	0.13703827375057637	validation:	0.06007159595758143
\end_layout

\begin_layout Plain Layout

Step 400 MSE:	0.13710864225063926	validation:	0.060927080836254505
\end_layout

\begin_layout Plain Layout

Step 500 MSE:	0.13628441179302378	validation:	0.060561340659516995
\end_layout

\begin_layout Plain Layout

Step 600 MSE:	0.13617224792439533	validation:	0.060528198078444624
\end_layout

\begin_layout Plain Layout

Step 700 MSE:	0.13630848199548856	validation:	0.060994931789631016
\end_layout

\begin_layout Plain Layout

Step 800 MSE:	0.13587077682566756	validation:	0.06170215261294328
\end_layout

\begin_layout Plain Layout

Step 900 MSE:	0.1356409637021347	validation:	0.059108311981262575
\end_layout

\begin_layout Plain Layout

Step 1000 MSE:	0.13570556026589223	validation:	0.05914588073689533
\end_layout

\end_inset


\end_layout

\begin_layout Subsection
CPU time consumption
\end_layout

\begin_layout Standard
JavaNNS does not allow to perform a exhaustive calculation of the CPU time
 consumption, but none of the learning process (1.000 cycles) has last more
 than 5 minutes using one core of a CPU Intel(R) Core(TM)2 Duo CPU E8400
 @ 3.00GHz.
 Simpler networks have performed significantly faster, the learning of the
 simplest one (PCA 70% and network with 4 neurons in the hidden layer) lasted
 less than 1 minute.
\end_layout

\begin_layout Subsection
Results analysis
\end_layout

\begin_layout Subsubsection
Data improvements and network design
\end_layout

\begin_layout Standard
Comparing the 3 analyzed datasets with the networks that use the binary
 representation, it has been demonstrated that reducing the number of original
 attributes by applying Principal Components Analysis has lead to worst
 classification results by the neural networks:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

# Step 1000 in binary representation networks
\end_layout

\begin_layout Plain Layout

Original - MSE:	0.3843637181159876	validation:	0.20900531362000127
\end_layout

\begin_layout Plain Layout

PCA 95%  - MSE:	0.47207291601169515	validation:	0.2579010439590669
\end_layout

\begin_layout Plain Layout

PCA 70%  - MSE:	0.8832434712441315	validation:	0.4077373583951626
\end_layout

\end_inset


\end_layout

\begin_layout Standard
In that sense, the same happens for networks with numeric representation
 of letters:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

# Step 1000 in numeric representation networks
\end_layout

\begin_layout Plain Layout

Original - MSE:	0.04939202475595762	validation:	0.025375765334192654
\end_layout

\begin_layout Plain Layout

PCA 95%  - MSE:	0.06980477428372317	validation:	0.03375271772234972
\end_layout

\begin_layout Plain Layout

PCA 70%  - MSE:	0.11635975930452506	validation:	0.051971885839778256
\end_layout

\end_inset


\end_layout

\begin_layout Standard
In the case of the network with numeric representation and dataset PCA 70
 %, extra analysis has been performed as described in section 
\begin_inset CommandInset ref
LatexCommand vref
reference "sub:Numeric-PCA-70-%"

\end_inset

.
 They show that between the 7, 6 and 4 hidden neurons versions the second
 one is a perfectly good choice.
 Although the 7 version reaches a lower mean square error in Step 1.000,
 it is not a huge difference compared to the computational time that supposes
 adding a neuron.
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

# Step 1000 in numeric representation networks with PCA 70%
\end_layout

\begin_layout Plain Layout

7 Hidden neurons - MSE:	0.11547352146734574	validation:	0.05138052845065183
\end_layout

\begin_layout Plain Layout

6 Hidden neurons - MSE:	0.11635975930452506	validation:	0.051971885839778256
\end_layout

\begin_layout Plain Layout

4 Hidden neurons - MSE:	0.13392397639417233	validation:	0.05920344147403955
\end_layout

\end_inset


\end_layout

\begin_layout Standard
Therefore, for this case of study, it seems a good design strategy to choose
 the maximum 
\begin_inset Formula $N_{hidden}=max\left(N_{input},N_{output}\right)$
\end_inset

 as the number of neurons for the hidden layer.
\end_layout

\begin_layout Standard
On the other hand, from the 6 hidden neuron version, the pruning process
 has generated a 4 hidden neurons scenario with some less connections.
 The error evolution is quite similar to the 4 hidden neurons version with
 all the connections:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

# Step 1000 in numeric representation networks with PCA 70%
\end_layout

\begin_layout Plain Layout

4 Hidden neurons - MSE:	0.13392397639417233	validation:	0.05920344147403955
\end_layout

\begin_layout Plain Layout

Pruned version   - MSE:	0.13570556026589223	validation:	0.05914588073689533
\end_layout

\end_inset


\end_layout

\begin_layout Standard
It is a computational improvement that could be interesting if the increase
 in the error margin is not a big problem.
\end_layout

\begin_layout Subsubsection
Binary vs numeric representation
\end_layout

\begin_layout Standard
A ruby script (check section 
\begin_inset CommandInset ref
LatexCommand vref
reference "sec:Annex-III.-JavaNNS-analysis"

\end_inset

) has been develop to analyze the best classification results for the JavaNNS
 networks with binary and numeric representations, which correspond to the
 original dataset (16 attributes).
\end_layout

\begin_layout Standard
For the network with binary representation of letters, the script performs
 the following steps:
\end_layout

\begin_layout Enumerate
For each binary value (26) of each object, consider correct classification
 by default and treat the following cases:
\end_layout

\begin_deeper
\begin_layout Enumerate
Desired output is one
\end_layout

\begin_deeper
\begin_layout Enumerate
Consider incorrect if the real output equal or less than 
\begin_inset Quotes eld
\end_inset

1 - margin_error
\begin_inset Quotes erd
\end_inset


\end_layout

\end_deeper
\begin_layout Enumerate
Desired output is zero
\end_layout

\begin_deeper
\begin_layout Enumerate
Consider incorrect if the real output more than 
\begin_inset Quotes eld
\end_inset

0 + margin_error
\begin_inset Quotes erd
\end_inset


\end_layout

\end_deeper
\end_deeper
\begin_layout Enumerate
Calculate total (in)correct classification and percentages
\end_layout

\begin_layout Enumerate
Calculate mean error 
\begin_inset Formula $e=\frac{\sum_{i=0}^{26\cdot total\, objects}\left|ouput_{real}-output_{desired}\right|}{26\cdot total\, objects}$
\end_inset


\end_layout

\begin_layout Standard
Margin error has been established to 0.5, therefore any number greater or
 equal to 0.5 is considered a 1, otherwise it is interpreted as a 0.
 These are the analysis results:
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\scriptsize},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

Correct classifications:	5880 (84.51%)
\end_layout

\begin_layout Plain Layout

Incorrect classifications:	1078 (15.49%)
\end_layout

\begin_layout Plain Layout

Mean error:			0.01
\end_layout

\end_inset


\end_layout

\begin_layout Standard
On the other hand, for the network with numeric representation of letters,
 the script performs the following steps:
\end_layout

\begin_layout Enumerate
For each object:
\end_layout

\begin_deeper
\begin_layout Enumerate
Consider correct classification if: 
\begin_inset Formula \[
ouput_{desired}-margin\, error\leq output_{real}\leq ouput_{desired}+margin\, error\]

\end_inset


\end_layout

\begin_layout Enumerate
Otherwise, consider incorrectly classified
\end_layout

\end_deeper
\begin_layout Enumerate
Calculate total (in)correct classification and percentages
\end_layout

\begin_layout Enumerate
Calculate mean error 
\begin_inset Formula $e=\frac{\sum_{i=0}^{total\, objects}\left|ouput_{real}-output_{desired}\right|}{total\, objects}$
\end_inset


\end_layout

\begin_layout Standard
The separation between consecutive letters is 0.04 in the numeric representation,
 therefore a margin error of 0.02 has been established.
 These are the analysis results:
\begin_inset listings
lstparams "basicstyle={\scriptsize},showstringspaces=false"
inline false
status open

\begin_layout Plain Layout

Correct classifications:	915 (13.15%)
\end_layout

\begin_layout Plain Layout

Incorrect classifications:	6043 (86.85%)
\end_layout

\begin_layout Plain Layout

Mean error:			0.11
\end_layout

\end_inset


\end_layout

\begin_layout Standard
It is clear that the design presented in this study for numeric representation
 of letters does not help to produce good classification results when working
 with neural networks, although they are much more efficient in term of
 CPU time than binary ones.
\end_layout

\begin_layout Section
Conclusions
\end_layout

\begin_layout Standard
In general the K-Nearest Neighbours method (Weka IBk), as a geometric classifier
 type, seems to be the better choice for letter classification.
 It has obtained the best percentage of correct classification for almost
 every used dataset (92.59% for original, 91.94% for PCA95 and 78.95% for PCA70).
\end_layout

\begin_layout Standard
On the other hand, comparing neural networks, it has been possible to design
 a network that correctly classifies letters in the 84.51% of the cases with
 JavaNNS, while the Weka MultilayerPerceptron (with autoBuild activated)
 reached 81.46%.
 Therefore results are very aligned for this type of algorithms with independenc
e of the implementation.
\end_layout

\begin_layout Standard
Finally, it is worth to mention how the percentage of correct classification
 has decreased (especially in the 70% of covered variance case) for those
 datasets where Principal Components Analysis has been performed.
 Although this method helps in simplifying the problem, it is important
 to check the reduction in the classification capacities of the algorithms.
 For example, in the case of K-Nearest Neighbours method and PCA 95%, the
 reduction was small (from 92.59% to 91.94%) but for PCA 70% the percentage
 fell significantly (from 92.59% to 78.95%).
\end_layout

\begin_layout Section
\begin_inset CommandInset label
LatexCommand label
name "sec:Annex-I.-StatisticalAnalysis"

\end_inset

Annex I.
 R script for statistical analysis
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},breaklines=true,commentstyle={\color{gray}},identifierstyle={\color{black}},keywordstyle={\color{blue}},language=R,numbers=left,numberstyle={\tiny},showstringspaces=false,stringstyle={\color{red}}"
inline false
status open

\begin_layout Plain Layout

library(rkward)
\end_layout

\begin_layout Plain Layout

library(GDD)
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# Read input file
\end_layout

\begin_layout Plain Layout

ocr.data <<- read.table (file="input/OCR.arff", header=FALSE, sep=',', quote='"',
 dec='.', fill=FALSE, comment.char="#", col.names = c("class", "x-box", "y-box",
 "width-box", "heigth-box", "npix", "x-var-pix", "y-var-pix", "x2bar", "y2bar",
 "xybar", "x2ybr", "xy2br", "x-ege", "xegvy", "y-ege", "yegvx"), na.strings
 = "NA", nrows = -1, skip = 59, check.names = TRUE, strip.white = FALSE, blank.line
s.skip = TRUE)
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# Select variable to be analized
\end_layout

\begin_layout Plain Layout

vars <- list (substitute (ocr.data[["yegvx"]]), substitute (ocr.data[["y2bar"]]),
 substitute (ocr.data[["y.var.pix"]]), substitute (ocr.data[["y.ege"]]), substitute
 (ocr.data[["y.box"]]), substitute (ocr.data[["xybar"]]), substitute (ocr.data[["xy2
br"]]), substitute (ocr.data[["xegvy"]]), substitute (ocr.data[["x2ybr"]]),
 substitute (ocr.data[["x2bar"]]), substitute (ocr.data[["x.var.pix"]]), substitute
 (ocr.data[["x.ege"]]), substitute (ocr.data[["x.box"]]), substitute (ocr.data[["widt
h.box"]]), substitute (ocr.data[["npix"]]), substitute (ocr.data[["heigth.box"]]))
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# Prepare result vector
\end_layout

\begin_layout Plain Layout

results <- data.frame ('Variable Name'=rep (NA, length (vars)), check.names=FALSE)
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

for (i in 1:length (vars))  {
\end_layout

\begin_layout Plain Layout

	var <- eval (vars[[i]], envir=globalenv());
\end_layout

\begin_layout Plain Layout

	
\end_layout

\begin_layout Plain Layout

	results[i, 'Variable Name'] <- rk.get.description(vars[[i]], is.substitute=TRUE)
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

    # Stats
\end_layout

\begin_layout Plain Layout

	results[i, 'Number of obs'] <- length(var)
\end_layout

\begin_layout Plain Layout

	results[i, 'Number of missing values'] <- sum(is.na(var))
\end_layout

\begin_layout Plain Layout

	results[i, 'Mean'] <- mean(var,na.rm=TRUE)
\end_layout

\begin_layout Plain Layout

	results[i, 'Variance'] <- var(var,na.rm=TRUE)
\end_layout

\begin_layout Plain Layout

	results[i, 'Sd'] <- sd(var,na.rm=TRUE)
\end_layout

\begin_layout Plain Layout

	results[i, 'Minimum'] <- min(var,na.rm=TRUE)
\end_layout

\begin_layout Plain Layout

	results[i, 'Maximum'] <- max(var,na.rm=TRUE)
\end_layout

\begin_layout Plain Layout

	if (length (var) >= 1) {
\end_layout

\begin_layout Plain Layout

		results[i, 'Minimum values'] <- paste (sort(var, decreasing=FALSE, na.last=TRUE
)[1:1], collapse=" ")
\end_layout

\begin_layout Plain Layout

	}
\end_layout

\begin_layout Plain Layout

	if (length (var) >= 1) {
\end_layout

\begin_layout Plain Layout

		results[i, 'Maximum values'] <- paste (sort(var, decreasing=TRUE, na.last=TRUE)
[1:1], collapse=" ")
\end_layout

\begin_layout Plain Layout

	}
\end_layout

\begin_layout Plain Layout

	results[i, 'Median'] <- median(var,na.rm=TRUE)
\end_layout

\begin_layout Plain Layout

	results[i, 'Inter Quartile Range'] <- IQR(var,na.rm=TRUE)
\end_layout

\begin_layout Plain Layout

	temp <- quantile (var,na.rm=TRUE)
\end_layout

\begin_layout Plain Layout

	results[i, 'Quartiles'] <- paste (names (temp), temp, sep=": ", collapse="
 ")
\end_layout

\begin_layout Plain Layout

	
\end_layout

\begin_layout Plain Layout

	# Histograms
\end_layout

\begin_layout Plain Layout

	filename <- paste(i, results[i, 'Variable Name'], sep=".")
\end_layout

\begin_layout Plain Layout

	plotname <- results[i, 'Variable Name']
\end_layout

\begin_layout Plain Layout

    GDD(file=paste("output/Histogram.", filename, sep=""), type="png", w=800,
 h=600)
\end_layout

\begin_layout Plain Layout

    hist(var, probability=TRUE, breaks=15, main=paste("Histogram for", plotname)
, xlab="Value")
\end_layout

\begin_layout Plain Layout

    rug(var)
\end_layout

\begin_layout Plain Layout

    dev.off()
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

}
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# Save stats
\end_layout

\begin_layout Plain Layout

write.table(results, file = "output/OCR-stats.csv", sep = ",", row.names =
 FALSE)
\end_layout

\end_inset


\end_layout

\begin_layout Section
\begin_inset CommandInset label
LatexCommand label
name "sec:Annex-II.-DataTransform"

\end_inset

Annex II.
 Ruby script for ARFF transformation into PAT
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},breaklines=true,commentstyle={\color{gray}},identifierstyle={\color{black}},keywordstyle={\color{blue}},language=Ruby,numbers=left,numberstyle={\tiny},showstringspaces=false,stringstyle={\color{red}}"
inline false
status open

\begin_layout Plain Layout

#!/usr/bin/ruby
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

files = ["OCR","OCR.PCA95","OCR.PCA70"]
\end_layout

\begin_layout Plain Layout

alphabet = {"A",0,"B",0,"C",0,"D",0,"E",0,"F",0,"G",0,"H",0,"I",0,"J",0,"K",0,
\end_layout

\begin_layout Plain Layout

"L",0,"M",0,"N",0,"O",0,"P",0,"Q",0,"R",0,"S",0,"T",0,"U",0,"V",0,"W",0,"X",0,"Y
",0,"Z",0}
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

files.each { |f|
\end_layout

\begin_layout Plain Layout

    infile = File.new("input/" + f + ".arff", "r")
\end_layout

\begin_layout Plain Layout

    outfilebin = File.new("output/binary_class/" + f  + ".pat", "w")
\end_layout

\begin_layout Plain Layout

    outfilebin_train = File.new("output/binary_class/" + f  + ".Train.pat",
 "w")
\end_layout

\begin_layout Plain Layout

    outfilebin_test = File.new("output/binary_class/" + f  + ".Test.pat", "w")
\end_layout

\begin_layout Plain Layout

    outfile = File.new("output/numeric_class/" + f + ".pat", "w")
\end_layout

\begin_layout Plain Layout

    outfile_train = File.new("output/numeric_class/" + f  + ".Train.pat", "w")
\end_layout

\begin_layout Plain Layout

    outfile_test = File.new("output/numeric_class/" + f  + ".Test.pat", "w")
\end_layout

\begin_layout Plain Layout

    
\end_layout

\begin_layout Plain Layout

    # Find min and max for each input parameter
\end_layout

\begin_layout Plain Layout

    process = false
\end_layout

\begin_layout Plain Layout

    total = 0
\end_layout

\begin_layout Plain Layout

    min = []
\end_layout

\begin_layout Plain Layout

    max = []
\end_layout

\begin_layout Plain Layout

    infile.each { |i|
\end_layout

\begin_layout Plain Layout

	    if (process) then
\end_layout

\begin_layout Plain Layout

	        v = i.split(",")
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

            for j in 0..(v.length - 1 - 1) # Do not process class (last column)
\end_layout

\begin_layout Plain Layout

                if max[j].nil? or max[j] < v[j].to_f then
\end_layout

\begin_layout Plain Layout

                    max[j] = v[j].to_f
\end_layout

\begin_layout Plain Layout

                end
\end_layout

\begin_layout Plain Layout

                if min[j].nil? or min[j] > v[j].to_f then
\end_layout

\begin_layout Plain Layout

                    min[j] = v[j].to_f
\end_layout

\begin_layout Plain Layout

                end
\end_layout

\begin_layout Plain Layout

            end
\end_layout

\begin_layout Plain Layout

            total = total + 1
\end_layout

\begin_layout Plain Layout

	    end
\end_layout

\begin_layout Plain Layout

	    if (i[0,5] == "@data") then
\end_layout

\begin_layout Plain Layout

		    process = true
\end_layout

\begin_layout Plain Layout

	    end
\end_layout

\begin_layout Plain Layout

    }
\end_layout

\begin_layout Plain Layout

    
\end_layout

\begin_layout Plain Layout

    #puts "max: " + max.join(" ")
\end_layout

\begin_layout Plain Layout

    #puts "min: " + min.join(" ")
\end_layout

\begin_layout Plain Layout

    
\end_layout

\begin_layout Plain Layout

    infile.close
\end_layout

\begin_layout Plain Layout

    infile = File.new("input/" + f + ".arff", "r")
\end_layout

\begin_layout Plain Layout

    
\end_layout

\begin_layout Plain Layout

    # Headers
\end_layout

\begin_layout Plain Layout

    outfile.write("SNNS pattern definition file V3.2
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile.write("generated at Mon Jan 10 15:58:23 2010
\backslash
n
\backslash
n
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile.write("No.
 of patterns : " + total.to_s + "
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile.write("No.
 of input units : " + max.length.to_s + "
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile.write("No.
 of output units : " + "1" + "
\backslash
n
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile_train.write("SNNS pattern definition file V3.2
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile_train.write("generated at Mon Jan 10 15:58:23 2010
\backslash
n
\backslash
n
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile_train.write("No.
 of patterns : " + (total * 0.70).round.to_s + "
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile_train.write("No.
 of input units : " + max.length.to_s + "
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile_train.write("No.
 of output units : " + "1" + "
\backslash
n
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile_test.write("SNNS pattern definition file V3.2
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile_test.write("generated at Mon Jan 10 15:58:23 2010
\backslash
n
\backslash
n
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile_test.write("No.
 of patterns : " + (total - (total * 0.70).round).to_s + "
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile_test.write("No.
 of input units : " + max.length.to_s + "
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfile_test.write("No.
 of output units : " + "1" + "
\backslash
n
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin.write("SNNS pattern definition file V3.2
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin.write("generated at Mon Jan 10 15:58:23 2010
\backslash
n
\backslash
n
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin.write("No.
 of patterns : " + total.to_s + "
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin.write("No.
 of input units : " + max.length.to_s + "
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin.write("No.
 of output units : " + "26" + "
\backslash
n
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin_train.write("SNNS pattern definition file V3.2
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin_train.write("generated at Mon Jan 10 15:58:23 2010
\backslash
n
\backslash
n
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin_train.write("No.
 of patterns : " + (total * 0.70).round.to_s + "
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin_train.write("No.
 of input units : " + max.length.to_s + "
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin_train.write("No.
 of output units : " + "26" + "
\backslash
n
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin_test.write("SNNS pattern definition file V3.2
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin_test.write("generated at Mon Jan 10 15:58:23 2010
\backslash
n
\backslash
n
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin_test.write("No.
 of patterns : " + (total - (total * 0.70).round).to_s + "
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin_test.write("No.
 of input units : " + max.length.to_s + "
\backslash
n")
\end_layout

\begin_layout Plain Layout

    outfilebin_test.write("No.
 of output units : " + "26" + "
\backslash
n
\backslash
n")
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

    process = false
\end_layout

\begin_layout Plain Layout

    count = 0
\end_layout

\begin_layout Plain Layout

    infile.each { |i|
\end_layout

\begin_layout Plain Layout

        if (process) then
\end_layout

\begin_layout Plain Layout

            v = i.split(",")
\end_layout

\begin_layout Plain Layout

            # Rescale/Normalize between 0..1
\end_layout

\begin_layout Plain Layout

            for j in 0..(v.length - 1 - 1) # Do not process class (last column)
\end_layout

\begin_layout Plain Layout

                if (max[j].to_f - min[j].to_f) != 0 then
\end_layout

\begin_layout Plain Layout

                    v[j] = (v[j].to_f - min[j].to_f) / (max[j].to_f - min[j].to_f)
\end_layout

\begin_layout Plain Layout

                end
\end_layout

\begin_layout Plain Layout

            end
\end_layout

\begin_layout Plain Layout

            
\end_layout

\begin_layout Plain Layout

            letter = v.pop # Extract and remove from vector the class (last
 column)
\end_layout

\begin_layout Plain Layout

		    # Binary array with order: V K W L A X M B Y N C Z O D P E Q F R G
 S H T I U J
\end_layout

\begin_layout Plain Layout

		    alphabet[letter[0,1]] = 1
\end_layout

\begin_layout Plain Layout

		    # Numerical value:
\end_layout

\begin_layout Plain Layout

		    value = 0
\end_layout

\begin_layout Plain Layout

            for j in 0..26
\end_layout

\begin_layout Plain Layout

                if alphabet.keys[j] == letter[0,1] then
\end_layout

\begin_layout Plain Layout

                    # Order: V K W L A X M B Y N C Z O D P E Q F R G S H
 T I U J
\end_layout

\begin_layout Plain Layout

                    #        0.................................................1
\end_layout

\begin_layout Plain Layout

                    #         with increments of 0.04
\end_layout

\begin_layout Plain Layout

                    value = j.to_f / 25 # From 0..25
\end_layout

\begin_layout Plain Layout

                    break
\end_layout

\begin_layout Plain Layout

                end
\end_layout

\begin_layout Plain Layout

            end
\end_layout

\begin_layout Plain Layout

            
\end_layout

\begin_layout Plain Layout

            outfilebin.write v.join(" ") + " " + alphabet.values.join(" ") +
 "
\backslash
n"
\end_layout

\begin_layout Plain Layout

            outfile.write v.join(" ") + " " + value.to_s + "
\backslash
n"
\end_layout

\begin_layout Plain Layout

            if count < (total * 0.70).round then
\end_layout

\begin_layout Plain Layout

                outfilebin_train.write v.join(" ") + " " + alphabet.values.join("
 ") + "
\backslash
n"
\end_layout

\begin_layout Plain Layout

                outfile_train.write v.join(" ") + " " + value.to_s + "
\backslash
n"
\end_layout

\begin_layout Plain Layout

            else
\end_layout

\begin_layout Plain Layout

                outfilebin_test.write v.join(" ") + " " + alphabet.values.join("
 ") + "
\backslash
n"
\end_layout

\begin_layout Plain Layout

                outfile_test.write v.join(" ") + " " + value.to_s + "
\backslash
n"
\end_layout

\begin_layout Plain Layout

            end
\end_layout

\begin_layout Plain Layout

            
\end_layout

\begin_layout Plain Layout

            alphabet[letter[0,1]] = 0
\end_layout

\begin_layout Plain Layout

            count = count + 1
\end_layout

\begin_layout Plain Layout

        end
\end_layout

\begin_layout Plain Layout

        if (i[0,5] == "@data") then
\end_layout

\begin_layout Plain Layout

		    process = true
\end_layout

\begin_layout Plain Layout

	    end
\end_layout

\begin_layout Plain Layout

    }
\end_layout

\begin_layout Plain Layout

    
\end_layout

\begin_layout Plain Layout

    infile.close
\end_layout

\begin_layout Plain Layout

    outfilebin.close
\end_layout

\begin_layout Plain Layout

    outfilebin_train.close
\end_layout

\begin_layout Plain Layout

    outfilebin_test.close
\end_layout

\begin_layout Plain Layout

    outfile.close
\end_layout

\begin_layout Plain Layout

    outfile_train.close
\end_layout

\begin_layout Plain Layout

    outfile_test.close
\end_layout

\begin_layout Plain Layout

    
\end_layout

\begin_layout Plain Layout

}
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

# Print conversion table
\end_layout

\begin_layout Plain Layout

#        V K W L A X M B Y N C Z O D P E Q F R G S H T I U J
\end_layout

\begin_layout Plain Layout

#        0.................................................1
\end_layout

\begin_layout Plain Layout

outfiletable = File.new("output/conversion_table.tx", "w")
\end_layout

\begin_layout Plain Layout

outfiletable.write "-------------------------------------------------------------
----------------------
\backslash
n"
\end_layout

\begin_layout Plain Layout

outfiletable.write "* Conversion table: Class, numeric and binary values
                              *
\backslash
n"
\end_layout

\begin_layout Plain Layout

outfiletable.write "-------------------------------------------------------------
----------------------
\backslash
n"
\end_layout

\begin_layout Plain Layout

outfiletable.write "Class
\backslash
t
\backslash
tNum.
\backslash
t
\backslash
t" + alphabet.keys.join(" ") + "
\backslash
n"
\end_layout

\begin_layout Plain Layout

outfiletable.write "-------------------------------------------------------------
----------------------
\backslash
n"
\end_layout

\begin_layout Plain Layout

count = 0.0
\end_layout

\begin_layout Plain Layout

i = 0
\end_layout

\begin_layout Plain Layout

while i < 26
\end_layout

\begin_layout Plain Layout

    alphabet[alphabet.keys[i]] = 1
\end_layout

\begin_layout Plain Layout

    outfiletable.write alphabet.keys[i] + "
\backslash
t=
\backslash
t" + count.to_s + "
\backslash
t=
\backslash
t" + alphabet.values.join(" ") + "
\backslash
n"
\end_layout

\begin_layout Plain Layout

    alphabet[alphabet.keys[i]] = 0
\end_layout

\begin_layout Plain Layout

    count = count + 0.04
\end_layout

\begin_layout Plain Layout

    i = i + 1
\end_layout

\begin_layout Plain Layout

end
\end_layout

\begin_layout Plain Layout

outfiletable.write "-------------------------------------------------------------
----------------------
\backslash
n"
\end_layout

\end_inset


\end_layout

\begin_layout Section
\begin_inset CommandInset label
LatexCommand label
name "sec:Annex-III.-JavaNNS-analysis"

\end_inset

Annex III.
 Ruby script for JavaNNS results analysis
\end_layout

\begin_layout Standard
\begin_inset listings
lstparams "basicstyle={\tiny},breaklines=true,commentstyle={\color{gray}},identifierstyle={\color{black}},keywordstyle={\color{blue}},language=Ruby,numbers=left,numberstyle={\tiny},showstringspaces=false,stringstyle={\color{red}}"
inline false
status open

\begin_layout Plain Layout

#!/usr/bin/ruby
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

infile = File.new("input/Binary - OCR Original.res", "r")
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

margin_error = 0.5
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

total_corrects = 0
\end_layout

\begin_layout Plain Layout

total_incorrects = 0
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

data_start = false
\end_layout

\begin_layout Plain Layout

data_line = 0
\end_layout

\begin_layout Plain Layout

error = 0
\end_layout

\begin_layout Plain Layout

desired_output = ""
\end_layout

\begin_layout Plain Layout

real_output = ""
\end_layout

\begin_layout Plain Layout

infile.each { |i|
\end_layout

\begin_layout Plain Layout

    # Begin data entry
\end_layout

\begin_layout Plain Layout

    if i[0,1] == "#" then
\end_layout

\begin_layout Plain Layout

        data_start = true
\end_layout

\begin_layout Plain Layout

        data_line = 0
\end_layout

\begin_layout Plain Layout

        desired_output = ""
\end_layout

\begin_layout Plain Layout

        real_output = ""
\end_layout

\begin_layout Plain Layout

    end
\end_layout

\begin_layout Plain Layout

    # Process data entry
\end_layout

\begin_layout Plain Layout

    if data_start then
\end_layout

\begin_layout Plain Layout

        # Build string with desired output
\end_layout

\begin_layout Plain Layout

        if data_line >= 3 and data_line <= 5 then
\end_layout

\begin_layout Plain Layout

            desired_output = desired_output + i[0,i.length-1] + " " # Skip
 
\backslash
n
\end_layout

\begin_layout Plain Layout

        end
\end_layout

\begin_layout Plain Layout

        
\end_layout

\begin_layout Plain Layout

        # Build string with real output
\end_layout

\begin_layout Plain Layout

        if data_line >= 6 and data_line <= 8 then
\end_layout

\begin_layout Plain Layout

            real_output = real_output + i[0,i.length-1] + " " # Skip 
\backslash
n
\end_layout

\begin_layout Plain Layout

        end
\end_layout

\begin_layout Plain Layout

        
\end_layout

\begin_layout Plain Layout

        # End of data entry => Check if it is correctly classfied
\end_layout

\begin_layout Plain Layout

        if data_line == 8 then
\end_layout

\begin_layout Plain Layout

            desired_output = desired_output.split " "
\end_layout

\begin_layout Plain Layout

            real_output = real_output.split " "
\end_layout

\begin_layout Plain Layout

            correct = true # Suppose correct by default
\end_layout

\begin_layout Plain Layout

            for i in 0..desired_output.length-1
\end_layout

\begin_layout Plain Layout

                if desired_output[i] == "1" then
\end_layout

\begin_layout Plain Layout

                    if real_output[i].to_f <= 1 - margin_error then
\end_layout

\begin_layout Plain Layout

                        correct = false
\end_layout

\begin_layout Plain Layout

                    end
\end_layout

\begin_layout Plain Layout

                else
\end_layout

\begin_layout Plain Layout

                    if real_output[i].to_f > 0 + margin_error then
\end_layout

\begin_layout Plain Layout

                        correct = false
\end_layout

\begin_layout Plain Layout

                    end
\end_layout

\begin_layout Plain Layout

                end
\end_layout

\begin_layout Plain Layout

                error = error + (real_output[i].to_f - desired_output[i].to_f).abs
\end_layout

\begin_layout Plain Layout

            end
\end_layout

\begin_layout Plain Layout

            
\end_layout

\begin_layout Plain Layout

            if correct then
\end_layout

\begin_layout Plain Layout

                total_corrects = total_corrects + 1
\end_layout

\begin_layout Plain Layout

            else
\end_layout

\begin_layout Plain Layout

                total_incorrects = total_incorrects + 1
\end_layout

\begin_layout Plain Layout

            end
\end_layout

\begin_layout Plain Layout

            data_start = false
\end_layout

\begin_layout Plain Layout

        end
\end_layout

\begin_layout Plain Layout

        
\end_layout

\begin_layout Plain Layout

        data_line = data_line + 1
\end_layout

\begin_layout Plain Layout

    end
\end_layout

\begin_layout Plain Layout

}
\end_layout

\begin_layout Plain Layout

puts "-------------------------------------------------------"
\end_layout

\begin_layout Plain Layout

puts "* Network with binary representation of letters       *"
\end_layout

\begin_layout Plain Layout

puts "-------------------------------------------------------"
\end_layout

\begin_layout Plain Layout

correct_percent = 100 * total_corrects.to_f / (total_corrects + total_incorrects)
\end_layout

\begin_layout Plain Layout

correct_percent = (100 * correct_percent).round.to_f / 100
\end_layout

\begin_layout Plain Layout

puts "Correct classifications:
\backslash
t" + total_corrects.to_s + " (" + correct_percent.to_s + "%)"
\end_layout

\begin_layout Plain Layout

incorrect_percent = 100 * total_incorrects.to_f / (total_corrects + total_incorre
cts)
\end_layout

\begin_layout Plain Layout

incorrect_percent = (100 * incorrect_percent).round.to_f / 100
\end_layout

\begin_layout Plain Layout

puts "Incorrect classifications:
\backslash
t" + total_incorrects.to_s + " (" + incorrect_percent.to_s + "%)"
\end_layout

\begin_layout Plain Layout

mean_error = error / (26 * (total_corrects + total_incorrects))
\end_layout

\begin_layout Plain Layout

mean_error = (100 * mean_error).round.to_f / 100
\end_layout

\begin_layout Plain Layout

puts "Mean error:
\backslash
t
\backslash
t
\backslash
t" + mean_error.to_s
\end_layout

\begin_layout Plain Layout

puts "-------------------------------------------------------"
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

infile = File.new("input/Numeric - OCR Original.res", "r")
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

margin_error = 0.02
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

total_corrects = 0
\end_layout

\begin_layout Plain Layout

total_incorrects = 0
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

data_start = false
\end_layout

\begin_layout Plain Layout

data_line = 0
\end_layout

\begin_layout Plain Layout

desired_output = -1
\end_layout

\begin_layout Plain Layout

real_output = -1
\end_layout

\begin_layout Plain Layout

error = 0
\end_layout

\begin_layout Plain Layout

infile.each { |i|
\end_layout

\begin_layout Plain Layout

    # Begin data entry
\end_layout

\begin_layout Plain Layout

    if i[0,1] == "#" then
\end_layout

\begin_layout Plain Layout

        data_start = true
\end_layout

\begin_layout Plain Layout

        data_line = 0
\end_layout

\begin_layout Plain Layout

        desired_output = -1
\end_layout

\begin_layout Plain Layout

        real_output = -1
\end_layout

\begin_layout Plain Layout

    end
\end_layout

\begin_layout Plain Layout

    # Process data entry
\end_layout

\begin_layout Plain Layout

    if data_start then
\end_layout

\begin_layout Plain Layout

        # Build string with desired output
\end_layout

\begin_layout Plain Layout

        if data_line == 3 then
\end_layout

\begin_layout Plain Layout

            desired_output = i.to_f
\end_layout

\begin_layout Plain Layout

        end
\end_layout

\begin_layout Plain Layout

        
\end_layout

\begin_layout Plain Layout

        # Build string with real output
\end_layout

\begin_layout Plain Layout

        if data_line == 4 then
\end_layout

\begin_layout Plain Layout

            real_output = i.to_f
\end_layout

\begin_layout Plain Layout

        end
\end_layout

\begin_layout Plain Layout

        
\end_layout

\begin_layout Plain Layout

        # End of data entry => Check if it is correctly classfied
\end_layout

\begin_layout Plain Layout

        if data_line == 4 then
\end_layout

\begin_layout Plain Layout

            
\end_layout

\begin_layout Plain Layout

            if real_output <= desired_output + margin_error and real_output
 >= desired_output - margin_error then
\end_layout

\begin_layout Plain Layout

                total_corrects = total_corrects + 1
\end_layout

\begin_layout Plain Layout

            else
\end_layout

\begin_layout Plain Layout

                total_incorrects = total_incorrects + 1
\end_layout

\begin_layout Plain Layout

            end
\end_layout

\begin_layout Plain Layout

            error = error + (real_output - desired_output).abs
\end_layout

\begin_layout Plain Layout

\end_layout

\begin_layout Plain Layout

            data_start = false
\end_layout

\begin_layout Plain Layout

        end
\end_layout

\begin_layout Plain Layout

        
\end_layout

\begin_layout Plain Layout

        data_line = data_line + 1
\end_layout

\begin_layout Plain Layout

    end
\end_layout

\begin_layout Plain Layout

}
\end_layout

\begin_layout Plain Layout

puts "-------------------------------------------------------"
\end_layout

\begin_layout Plain Layout

puts "* Network with numeric representation of letters      *"
\end_layout

\begin_layout Plain Layout

puts "-------------------------------------------------------"
\end_layout

\begin_layout Plain Layout

correct_percent = 100 * total_corrects.to_f / (total_corrects + total_incorrects)
\end_layout

\begin_layout Plain Layout

correct_percent = (100 * correct_percent).round.to_f / 100
\end_layout

\begin_layout Plain Layout

puts "Correct classifications:
\backslash
t" + total_corrects.to_s + " (" + correct_percent.to_s + "%)"
\end_layout

\begin_layout Plain Layout

incorrect_percent = 100 * total_incorrects.to_f / (total_corrects + total_incorre
cts)
\end_layout

\begin_layout Plain Layout

incorrect_percent = (100 * incorrect_percent).round.to_f / 100
\end_layout

\begin_layout Plain Layout

puts "Incorrect classifications:
\backslash
t" + total_incorrects.to_s + " (" + incorrect_percent.to_s + "%)"
\end_layout

\begin_layout Plain Layout

mean_error = error / (total_corrects + total_incorrects)
\end_layout

\begin_layout Plain Layout

mean_error = (100 * mean_error).round.to_f / 100
\end_layout

\begin_layout Plain Layout

puts "Mean error:
\backslash
t
\backslash
t
\backslash
t" + mean_error.to_s
\end_layout

\begin_layout Plain Layout

puts "-------------------------------------------------------"
\end_layout

\end_inset


\end_layout

\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
key "key-3"

\end_inset

Luri, X.
 (2010).
 
\emph on
Multivariate analysis.
 PCA.

\emph default
 Universitat de Barcelona.
\end_layout

\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
key "key-2"

\end_inset

Witten, I.H., Eibe, F (2005).
 
\emph on
Data Mining, Practical Machine Learning Tools and Techniques.

\emph default
 2nd Edition.
 Elsevier.
\end_layout

\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
key "key-1"

\end_inset

Wikipedia.
 
\emph on
OneR
\emph default
.
 Retrieved January 9, 2010, from the World Wide Web: http://en.wikipedia.org/wiki/
Association_rule_learning#One-attribute-rule
\end_layout

\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
key "key-4"

\end_inset

Wikipedia.
 
\emph on
C4.5 algorithm.

\emph default
 Retrieved January 9, 2010, from the World Wide Web: http://en.wikipedia.org/wiki/
C4.5_algorithm
\end_layout

\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
key "key-3"

\end_inset

Wikipedia.
 
\emph on
K-Nearest neigbor algorithm.

\emph default
 Retrieved January 9, 2010, from the World Wide Web: http://en.wikipedia.org/wiki/
K-nearest_neighbor_algorithm
\end_layout

\end_body
\end_document
